Skip to content

Commit

Permalink
made cascadee callable
Browse files Browse the repository at this point in the history
  • Loading branch information
satyr committed Oct 3, 2012
1 parent 73a1245 commit 1b2d436
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/coco.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parser.lexer = {
return ''; return '';
} }
}; };
exports.VERSION = '0.8.2'; exports.VERSION = '0.8.3b';
exports.compile = function(code, options){ exports.compile = function(code, options){
var e, that; var e, that;
try { try {
Expand Down
4 changes: 2 additions & 2 deletions lib/lexer.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ exports.doLiteral = function(code, index){
break; break;
case '&': case '&':
if (!able(this.tokens)) { if (!able(this.tokens)) {
tag = 'LITERAL'; this.token('LITERAL', '&', true);
break; return 1;
} }
// fallthrough // fallthrough
case '|': case '|':
Expand Down
2 changes: 1 addition & 1 deletion src/coco.co
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parser import
upcomingInput : -> '' upcomingInput : -> ''


exports import exports import
VERSION: \0.8.2 VERSION: \0.8.3b


# Compiles a string of Coco code to JavaScript. # Compiles a string of Coco code to JavaScript.
compile: (code, options) -> compile: (code, options) ->
Expand Down
4 changes: 2 additions & 2 deletions src/lexer.co
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ exports import
tag = \UNARY tag = \UNARY
case \& case \&
unless able @tokens unless able @tokens
tag = \LITERAL @token \LITERAL \& true
break return 1
fallthrough fallthrough
case \| then tag = \BITWISE case \| then tag = \BITWISE
case \~ case \~
Expand Down
3 changes: 3 additions & 0 deletions test/literal.co
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -438,4 +438,7 @@ eq 10, do
& + 3 & + 3
4 + & 4 + &


ok
& true

compileThrows 'stray cascadee' 2 '\n&' compileThrows 'stray cascadee' 2 '\n&'

0 comments on commit 1b2d436

Please sign in to comment.