fix *=- (close #35)

This commit is contained in:
Nicolas Cannasse
2015-09-03 21:01:52 +02:00
parent 023b7349f8
commit db4976d89a
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -90,6 +90,7 @@ class Test {
test("var x=-3; x", -3);
test("var a:Array<Dynamic>=[1,2,4]; a[2]", 4, null, true);
test("/**/0", 0);
test("x=1;x*=-2", -2);
trace("Done");
}
+3 -1
View File
@@ -1063,14 +1063,16 @@ class Parser {
default:
if( ops[char] ) {
var op = String.fromCharCode(char);
var prev = -1;
while( true ) {
char = readChar();
if( !ops[char] ) {
if( !ops[char] || prev == '='.code ) {
if( op.charCodeAt(0) == '/'.code )
return tokenComment(op,char);
this.char = char;
return TOp(op);
}
prev = char;
op += String.fromCharCode(char);
}
}