From e2f3c2259b4802298fe9d8ea3bcbcff50df7de3e Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Fri, 12 Feb 2010 22:21:22 -0500 Subject: [PATCH] fix prototype_access lexing --- lib/coffee_script/lexer.js | 2 +- src/lexer.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee_script/lexer.js b/lib/coffee_script/lexer.js index f67993a3..1e27e9b9 100644 --- a/lib/coffee_script/lexer.js +++ b/lib/coffee_script/lexer.js @@ -107,7 +107,7 @@ tag = 'LEADING_WHEN'; } if (tag === 'IDENTIFIER' && this.value() === '::') { - this.tag(-1, 'PROTOTYPE_ACCESS'); + this.tag(1, 'PROTOTYPE_ACCESS'); } if (tag === 'IDENTIFIER' && this.value() === '.' && !(this.value(2) === '.')) { if (this.tag(2) === '?') { diff --git a/src/lexer.coffee b/src/lexer.coffee index 26f9b964..3d430088 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -98,7 +98,7 @@ lex::identifier_token: -> # 'if' will result in an ['IF', "if"] token. tag: if KEYWORDS.indexOf(id) >= 0 then id.toUpperCase() else 'IDENTIFIER' tag: 'LEADING_WHEN' if tag is 'WHEN' and BEFORE_WHEN.indexOf(@tag()) >= 0 - @tag(-1, 'PROTOTYPE_ACCESS') if tag is 'IDENTIFIER' and @value() is '::' + @tag(1, 'PROTOTYPE_ACCESS') if tag is 'IDENTIFIER' and @value() is '::' if tag is 'IDENTIFIER' and @value() is '.' and !(@value(2) is '.') if @tag(2) is '?' @tag(1, 'SOAK_ACCESS')