Small helper function
This commit is contained in:
@@ -2035,6 +2035,12 @@ class Parser {
|
||||
return TConst( CString(b.toString()) );
|
||||
}
|
||||
|
||||
function peekToken():Token {
|
||||
var t = token();
|
||||
push(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
function token(/*?infos : Null<haxe.PosInfos>*/) {
|
||||
//function ttrace(v:Dynamic, ?infos : Null<haxe.PosInfos>) {
|
||||
// Sys.print(infos.fileName+":"+infos.lineNumber+": " + Std.string(v));
|
||||
@@ -2042,6 +2048,7 @@ class Parser {
|
||||
//}
|
||||
|
||||
#if hscriptPos
|
||||
// Maybe have if( tokens.isEmpty() )
|
||||
var t = tokens.pop();
|
||||
if( t != null ) {
|
||||
tokenMin = t.min;
|
||||
|
||||
@@ -28,6 +28,7 @@ class SwitchCase extends TestCase {
|
||||
|
||||
Util.runKnownBug("Switch statement with multiple cases in parentheses", () -> {
|
||||
assertEq("switch(5) { case (1|4): 'error'; default: -1; }", switch(5) { case (1|4): 'error'; default: -1; });
|
||||
assertEq("switch(6) { case (1|4|(6|7)): 6; default: -1; }", switch(6) { case (1|4|(6|7)): 6; default: -1; });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user