-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ruleguard: continue pattern matching for multi-match patterns (#340)
This is probably a temporary and sub-optimal solution, but it should do for now. Since matches are much more rare than pattern misses, we do the check under the `matched` condition. Extra condition shouldn't make anything measurably slower there. Fixes #339
- Loading branch information
Showing
4 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package regression | ||
|
||
func _() { | ||
println("339") // want `\Qpattern1` | ||
println("x") // want `\Qpattern2` | ||
|
||
println("339") // want `\Qpattern1` | ||
|
||
println("x") | ||
} | ||
|
||
func _() { | ||
println("x") // want `\Qpattern2` | ||
println("339") // want `\Qpattern1` | ||
|
||
println("x") // want `\Qpattern2` | ||
println("339") // want `\Qpattern1` | ||
|
||
println("x") | ||
println("x") // want `\Qpattern2` | ||
println("339") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters