fix
This commit is contained in:
@@ -73,6 +73,8 @@ class Test {
|
||||
test("{ x = 3; x; }", 3);
|
||||
test("{ x : 3, y : {} }.x", 3);
|
||||
test("function bug(){ \n }\nbug().x", null);
|
||||
test("1 + 2 == 3", true);
|
||||
test("-2 == 3 - 5", true);
|
||||
trace("Done");
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,8 @@ class Macro {
|
||||
for( f in fields )
|
||||
tf.push( { field : f.name, expr : convert(f.e) } );
|
||||
EObjectDecl(tf);
|
||||
case ETernary(cond, e1, e2):
|
||||
ETernary(convert(cond), convert(e1), convert(e2));
|
||||
}, pos : #if hscriptPos { file : p.file, min : e.pmin, max : e.pmax } #else p #end }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@ class Parser {
|
||||
function makeUnop( op, e ) {
|
||||
return switch( expr(e) ) {
|
||||
case EBinop(bop, e1, e2): mk(EBinop(bop, makeUnop(op, e1), e2), pmin(e1), pmax(e2));
|
||||
case ETernary(e1,e2,e3): mk(ETernary(makeUnop(op,e1),e2,e3),pmin(e1)
|
||||
case ETernary(e1, e2, e3): mk(ETernary(makeUnop(op, e1), e2, e3), pmin(e1), pmax(e3));
|
||||
default: mk(EUnop(op,true,e),pmin(e),pmax(e));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user