Permalink
Browse files

fixed #162

  • Loading branch information...
1 parent 2ebe75c commit 9c3aa96dc2aa400822245bf21ccd2098866f7ef2 @satyr committed Aug 14, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 lib/lexer.js
  2. +1 −1 src/lexer.co
  3. +6 −0 test/literal.co
View
2 lib/lexer.js
@@ -213,7 +213,7 @@ exports.doID = function(code, index){
if (!last[1] && ((ref$ = last[0]) === 'CATCH' || ref$ === 'FUNCTION' || ref$ === 'LABEL')) {
last[1] = id;
last.spaced = false;
- return id.length;
+ return input.length;
}
tag = 'ID';
switch (id) {
View
2 src/lexer.co
@@ -143,7 +143,7 @@ exports import
@carp "reserved word \"#id\"" if id of KEYWORDS_UNUSED
if not last.1 and last.0 of <[ CATCH FUNCTION LABEL ]>
last <<< {1: id, -spaced}
- return id.length
+ return input.length
tag = \ID
# contextual keywords (reserved only in specific places)
switch id
View
6 test/literal.co
@@ -2,6 +2,12 @@
eq encodeURIComponent, encode-URI-component
eq ''.toLowerCase, ''.to-lower-case
+function no-op then
+eq no-op(), void
+eq noOp.length, 0
+
+try throw 0 catch e-r eq eR, 0
+
### Numbers

0 comments on commit 9c3aa96

Please sign in to comment.