bug: x-- * y · Issue #138 · satyr/coco (original) (raw)

coco> x = 10
..... y = 5
..... x-- * y
Error: Parse error on line 5: Unexpected ','

Expected output 50
Expected compilation:

var x, y;
x = 10;
y = 5;
x-- * y;

(as in CoffeeScript)

Tokens being produced:

ID:x CREMENT:-- , STRNUM:* , ID:y

Before rewriting:

ID:x CREMENT:-- STRNUM:* ID:y

Expected tokens:

ID:a CREMENT:-- MATH:* ID:b

This is due to on line 401 of lexer.co able @tokens evaluating to false.

As mentioned by @josher19 in jashkenas/coffeescript#2370