Skip to content

Commit

Permalink
fixed #162
Browse files Browse the repository at this point in the history
  • Loading branch information
satyr committed Aug 14, 2012
1 parent 2ebe75c commit 9c3aa96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.co
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/literal.co
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9c3aa96

Please sign in to comment.