-
Caleb Spare authored
The one-pass transformation is structured as a search over the input machine for conditions that violate the one-pass requisites. At each iteration, we should fully explore all non-input paths that proceed from the current instruction; this is implemented via recursive check calls. But when we reach instructions that demand input (InstRune*), these should be put onto the search queue. Instead of searching this way, the routine previously (effectively) proceeded through the machine one instruction at a time until finding an Inst{Match,Fail,Rune*}, calling check on each instruction. This caused bug #11905, where the transformation stopped before rewriting all InstAlts as InstAltMatches. Further, the check function unnecessarily recurred on InstRune* instructions. (I believe this helps to mask the above bug.) This change also deletes some unused functions and duplicate test cases. Fixes #11905. Change-Id: I5b0b26efea3d3bd01c7479a518b5ed1b886701cd Reviewed-on: https://go-review.googlesource.com/17195Reviewed-by:
Russ Cox <rsc@golang.org>
e36bf614
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
syntax | ||
testdata | ||
all_test.go | ||
backtrack.go | ||
example_test.go | ||
exec.go | ||
exec2_test.go | ||
exec_test.go | ||
find_test.go | ||
onepass.go | ||
onepass_test.go | ||
regexp.go |