rewriting the compiler to use half-expression assignment

This commit is contained in:
Jeremy Ashkenas
2010-03-21 23:33:24 -04:00
parent cbfe7f5822
commit 16f9a2e6b7
9 changed files with 71 additions and 71 deletions

View File

@@ -30,7 +30,7 @@ lexer: new Lexer()
# Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison
# compiler.
exports.compile: compile: (code, options) ->
options ||= {}
options: or {}
try
(parser.parse lexer.tokenize code).compile options
catch err
@@ -68,7 +68,7 @@ exports.extend: (func) ->
parser.lexer: {
lex: ->
token: @tokens[@pos] or [""]
@pos += 1
@pos: + 1
this.yylineno: token[2]
this.yytext: token[1]
token[0]