mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-08 16:19:17 +03:00
Rename stack to ruleStack
This commit is contained in:
parent
3a66aab59d
commit
2722fe7d72
@ -25,13 +25,13 @@ class TextMateGrammar
|
||||
for name, data of repository
|
||||
@repository[name] = new Rule(this, data)
|
||||
|
||||
getLineTokens: (line, stack=[@initialRule]) ->
|
||||
stack = new Array(stack...) # clone stack
|
||||
getLineTokens: (line, ruleStack=[@initialRule]) ->
|
||||
ruleStack = new Array(ruleStack...) # clone ruleStack
|
||||
tokens = []
|
||||
position = 0
|
||||
|
||||
loop
|
||||
scopes = scopesFromStack(stack)
|
||||
scopes = scopesFromStack(ruleStack)
|
||||
|
||||
if line.length == 0
|
||||
tokens = [{value: "", scopes: scopes}]
|
||||
@ -39,7 +39,7 @@ class TextMateGrammar
|
||||
|
||||
break if position == line.length
|
||||
|
||||
if match = _.last(stack).getNextTokens(stack, line, position)
|
||||
if match = _.last(ruleStack).getNextTokens(ruleStack, line, position)
|
||||
{ nextTokens, tokensStartPosition, tokensEndPosition } = match
|
||||
if position < tokensStartPosition # unmatched text before next tokens
|
||||
tokens.push
|
||||
@ -55,7 +55,7 @@ class TextMateGrammar
|
||||
scopes: scopes
|
||||
break
|
||||
|
||||
{ tokens, stack }
|
||||
{ tokens, stack: ruleStack }
|
||||
|
||||
ruleForInclude: (name) ->
|
||||
if name[0] == "#"
|
||||
|
Loading…
Reference in New Issue
Block a user