mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Make grammar handle lines that don't match *any* of the current rule's patterns
It's possible to get a match based on a lookahead, but not actually have any non-empty capture groups. This should be considered a failed match.
This commit is contained in:
@@ -92,7 +92,9 @@ class Rule
|
||||
regexPatternPairs
|
||||
|
||||
getNextTokens: (stack, line, position) ->
|
||||
return {} unless tree = @regex.getCaptureTree(line, position)
|
||||
tree = @regex.getCaptureTree(line, position)
|
||||
return {} unless tree?.captures
|
||||
|
||||
match = tree.captures[0]
|
||||
pattern = @patternsByCaptureIndex[match.index]
|
||||
@adjustCaptureTreeIndices(match, match.index)
|
||||
|
||||
Reference in New Issue
Block a user