getNextMatch no longer called

This commit is contained in:
Corey Johnson
2012-09-24 11:17:31 -07:00
parent 6bd7ff2be2
commit 70e31b9677

View File

@@ -93,19 +93,6 @@ class Rule
nextTokens = patterns[index].handleMatch(stack, line, captureIndices)
{ nextTokens, tokensStartPosition: firstCaptureStart, tokensEndPosition: firstCaptureEnd }
getNextMatch: (line, position) ->
nextMatch = null
matchedPattern = null
for pattern in @patterns
{ pattern, match } = pattern.getNextMatch(line, position)
if match
if !nextMatch or match.position < nextMatch.position
nextMatch = match
matchedPattern = pattern
{ match: nextMatch, pattern: matchedPattern }
addEndPattern: (backReferences) ->
endPattern = @createEndPattern(backReferences)
@patterns.unshift(endPattern)
@@ -145,13 +132,6 @@ class Pattern
else
[this]
getNextMatch: (line, position) ->
if @include
rule = @grammar.ruleForInclude(@include)
rule.getNextMatch(line, position)
else
{ match: @regex.getCaptureIndices(line, position), pattern: this }
handleMatch: (stack, line, captureIndices) ->
scopes = scopesFromStack(stack)
scopes.push(@scopeName) if @scopeName and not @popRule