fix *=- (close #35)
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user