Fix Trigraph bug

This commit is contained in:
Ne_Eo
2024-07-26 04:24:37 +02:00
parent e0e1436930
commit 123a7de64a
3 changed files with 5 additions and 3 deletions
+2
View File
@@ -1,2 +1,4 @@
/hscript.swf /hscript.swf
/release.zip /release.zip
tests/bin/*
+1 -1
View File
@@ -183,7 +183,7 @@ class Interp {
assignOp("<<=", function(v1, v2) return v1 << v2); assignOp("<<=", function(v1, v2) return v1 << v2);
assignOp(">>=", function(v1, v2) return v1 >> v2); assignOp(">>=", function(v1, v2) return v1 >> v2);
assignOp(">>>=", function(v1, v2) return v1 >>> v2); assignOp(">>>=", function(v1, v2) return v1 >>> v2);
assignOp("??=", function(v1, v2) return v1 == null ? v2 : v1); assignOp("??" + "=", function(v1, v2) return v1 == null ? v2 : v1);
} }
function checkIsType(e1,e2): Bool { function checkIsType(e1,e2): Bool {
+2 -2
View File
@@ -126,7 +126,7 @@ class Parser {
["..."], ["..."],
["&&"], ["&&"],
["||"], ["||"],
["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","&=","^=","=>","??="], ["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","&=","^=","=>","??" + "="],
["->", "??"], ["->", "??"],
["is"] ["is"]
]; ];
@@ -1815,7 +1815,7 @@ class Parser {
case '?'.code: case '?'.code:
var orp = readPos; var orp = readPos;
if (readChar() == '='.code) if (readChar() == '='.code)
return TOp("??="); return TOp("??" + "=");
this.readPos = orp; this.readPos = orp;
return TOp("??"); return TOp("??");