Switch to Jison's lexer.

This commit is contained in:
Zach Carter
2010-12-14 19:07:05 -05:00
parent ec948c7382
commit 97536f897e
10 changed files with 51 additions and 233 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
require "spec_helper"
describe "Tokenizer" do
let(:handlebars) { @context["Handlebars"] }
let(:lexer) { handlebars["HandlebarsLexer"].new }
let(:parser) { @context["handlebars"] }
let(:lexer) { @context["handlebars"]["lexer"] }
Token = Struct.new(:name, :text)
@@ -10,7 +10,7 @@ describe "Tokenizer" do
lexer.setInput(string)
out = []
while result = lexer.lex
while result = parser.terminals_[lexer.lex] and result != "EOF"
out << Token.new(result, lexer.yytext)
end