optimization: only tokens containing tabs are split into multiple tokens

This commit is contained in:
Corey Johnson
2012-05-14 13:30:09 -07:00
parent 171e4cc2a5
commit facd7082d0

View File

@@ -17,6 +17,8 @@ class Token
[new Token(value: value1, type: @type), new Token(value: value2, type: @type)]
breakOutTabCharacters: (tabText) ->
return [this] unless /\t/.test(tabText)
for substring in @value.match(/([^\t]+|\t)/g)
if substring == '\t'
@buildTabToken(tabText)