Push filler tokens when no patterns match an empty line

This ensures that empty lines always contain tokens even when no
patterns match on empty lines.
This commit is contained in:
Kevin Sawicki
2013-08-31 10:00:16 -07:00
parent 4850636092
commit d78f455b23

View File

@@ -145,7 +145,7 @@ class TextMateGrammar
break if position is line.length and nextTokens.length is 0 and ruleStack.length is previousRuleStackLength
else # push filler token for unmatched text at end of line
if position < line.length
if position < line.length or line.length == 0
tokens.push(new Token(
value: line[position...line.length]
scopes: scopes