Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions Test.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ class Test extends TestCase {
function test():Void {
assertScript("0",0);
assertScript("0xFF", 255);
#if !(php || python)
#if haxe3
assertScript("0xBFFFFFFF", 0xBFFFFFFF);
assertScript("0x7FFFFFFF", 0x7FFFFFFF);
#elseif !neko
assertScript("n(0xBFFFFFFF)", 0xBFFFFFFF, { n : haxe.Int32.toNativeInt });
assertScript("n(0x7FFFFFFF)", 0x7FFFFFFF, { n : haxe.Int32.toNativeInt } );
#end
#end
assertScript("0xBFFFFFFF", 0xBFFFFFFF);
assertScript("0x7FFFFFFF", 0x7FFFFFFF);
assertScript("-123",-123);
assertScript("- 123",-123);
assertScript("1.546",1.546);
Expand Down
4 changes: 2 additions & 2 deletions hscript/Parser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ class Parser {
// in case of '...'
if( exp == 10 && readChar() == 46 ) {
push(TOp("..."));
var i = Std.int(n);
var i = Std.int(n) & 0xFFFFFFFF;
return TConst( (i == n) ? CInt(i) : CFloat(n) );
}
invalidChar(char);
Expand All @@ -1006,7 +1006,7 @@ class Parser {
n = (n << 4) + (char - 87);
default:
this.char = char;
return TConst(CInt(n));
return TConst(CInt(n & 0xFFFFFFFF));
}
}
#else
Expand Down