File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 226
226
if ( val == 0 ) { // it's shorter just to write quotes
227
227
resultCode += String . fromCharCode ( LEX_RAW_INT0 ) ;
228
228
} else if ( val >= - 128 && val < 128 )
229
- resultCode += String . fromCharCode ( LEX_RAW_INT8 , val ) ;
229
+ resultCode += String . fromCharCode ( LEX_RAW_INT8 , val & 255 ) ;
230
230
else if ( val >= - 32768 && val < 32768 )
231
231
resultCode += String . fromCharCode ( LEX_RAW_INT16 , val & 255 , ( val >> 8 ) & 255 ) ;
232
232
else
282
282
let len = code . charCodeAt ( i + 1 ) | ( code . charCodeAt ( i + 2 ) << 8 ) ;
283
283
resultCode += Espruino . Core . Utils . toJSONishString ( code . substring ( i + 3 , i + 3 + len ) ) ;
284
284
i += 2 + len ;
285
+ } else if ( ch == LEX_RAW_INT0 ) { // decode raw strings
286
+ resultCode += "0" ;
287
+ } else if ( ch == LEX_RAW_INT8 ) { // decode raw strings
288
+ let val = code . charCodeAt ( i + 1 ) ;
289
+ resultCode += val . toString ( ) ;
290
+ i += 1 ;
291
+ } else if ( ch == LEX_RAW_INT16 ) {
292
+ let val = code . charCodeAt ( i + 1 ) | ( code . charCodeAt ( i + 2 ) << 8 ) ;
293
+ resultCode += val . toString ( ) ;
294
+ i += 2 ;
285
295
} else if ( ch < LEX_OPERATOR_START + TOKENS . length ) // decoded other tokens
286
296
resultCode += TOKENS [ ch - LEX_OPERATOR_START ] ;
287
297
else {
You can’t perform that action at this time.
0 commit comments