Permalink
Browse files

made cascadee callable

  • Loading branch information...
1 parent 73a1245 commit 1b2d43625d2cf1a223b40a125cdba867d3a9dba7 @satyr committed Oct 3, 2012
Showing with 9 additions and 6 deletions.
  1. +1 −1 lib/coco.js
  2. +2 −2 lib/lexer.js
  3. +1 −1 src/coco.co
  4. +2 −2 src/lexer.co
  5. +3 −0 test/literal.co
View
@@ -16,7 +16,7 @@ parser.lexer = {
return '';
}
};
-exports.VERSION = '0.8.2';
+exports.VERSION = '0.8.3b';
exports.compile = function(code, options){
var e, that;
try {
View
@@ -652,8 +652,8 @@ exports.doLiteral = function(code, index){
break;
case '&':
if (!able(this.tokens)) {
- tag = 'LITERAL';
- break;
+ this.token('LITERAL', '&', true);
+ return 1;
}
// fallthrough
case '|':
View
@@ -15,7 +15,7 @@ parser import
upcomingInput : -> ''
exports import
- VERSION: \0.8.2
+ VERSION: \0.8.3b
# Compiles a string of Coco code to JavaScript.
compile: (code, options) ->
View
@@ -424,8 +424,8 @@ exports import
tag = \UNARY
case \&
unless able @tokens
- tag = \LITERAL
- break
+ @token \LITERAL \& true
+ return 1
fallthrough
case \| then tag = \BITWISE
case \~
View
@@ -438,4 +438,7 @@ eq 10, do
& + 3
4 + &
+ok
+ & true
+
compileThrows 'stray cascadee' 2 '\n&'

0 comments on commit 1b2d436

Please sign in to comment.