Skip to content

Commit 0916756

Browse files
committed
Fix issue with pretokeniser and large negative numbers (<-32768)
1 parent e095a18 commit 0916756

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/espruinotools.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// EspruinoTools bundle (https://github.com/espruino/EspruinoTools)
22
// Created with https://github.com/espruino/EspruinoWebIDE/blob/master/extras/create_espruinotools_js.sh
3-
// Based on EspruinoWebIDE 0.79.14
3+
// Based on EspruinoWebIDE 0.79.15
44
/**
55
Copyright 2014 Gordon Williams ([email protected])
66

@@ -37371,8 +37371,10 @@ global.esmangle = require('../lib/esmangle');
3737137371
resultCode += String.fromCharCode(LEX_RAW_INT8, val&255);
3737237372
else if (val>=-32768 && val<32768)
3737337373
resultCode += String.fromCharCode(LEX_RAW_INT16, val&255, (val>>8)&255);
37374-
else
37374+
else {
37375+
if (val<0) resultCode += "-"; // re-add the '-' we took off
3737537376
resultCode += tokenString;
37377+
}
3737637378
} else resultCode += tokenString;
3737737379
} else if (tokenId) {
3737837380
//console.log(JSON.stringify(tok.str)+" => "+tokenId);

0 commit comments

Comments
 (0)