Skip to content

Commit

Permalink
When decoding Strings, try and decode them in a more espruino-friendl…
Browse files Browse the repository at this point in the history
…y way
  • Loading branch information
gfwilliams committed Jun 10, 2024
1 parent ad7db61 commit 516df3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/pretokenise.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@
if (ch>=LEX_OPERATOR_START) {
if (ch==LEX_RAW_STRING8) { // decode raw strings
var len = code.charCodeAt(i+1);
resultCode += JSON.stringify(code.substring(i+2, i+2+len));
resultCode += Espruino.Core.Utils.toJSONishString(code.substring(i+2, i+2+len));
i+=1+len;
} else if (ch==LEX_RAW_STRING16) {
var len = code.charCodeAt(i+1) | (code.charCodeAt(i+2)<<8);
resultCode += JSON.stringify(code.substring(i+3, i+3+len));
resultCode += Espruino.Core.Utils.toJSONishString(code.substring(i+3, i+3+len));
i+=2+len;
} else if (ch<LEX_OPERATOR_START+TOKENS.length) // decoded other tokens
resultCode += TOKENS[ch-LEX_OPERATOR_START];
Expand Down

0 comments on commit 516df3b

Please sign in to comment.