summaryrefslogtreecommitdiff
path: root/src/llex.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-09 15:23:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-09 16:17:20 +1000
commitd47c82caf02bd21d05700c48a52d8be69db9ad7d (patch)
tree2947ff34d75a7fd70c8ceba18193bdb9e20a8902 /src/llex.js
parent8f188fb2f792223f1a0c1730bd4ac99418d81d74 (diff)
downloadfengari-d47c82caf02bd21d05700c48a52d8be69db9ad7d.tar.gz
fengari-d47c82caf02bd21d05700c48a52d8be69db9ad7d.tar.bz2
fengari-d47c82caf02bd21d05700c48a52d8be69db9ad7d.zip
src/llex.js: Use luaO_pushfstring instead of javascript string interpolation
Diffstat (limited to 'src/llex.js')
-rw-r--r--src/llex.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llex.js b/src/llex.js
index 8abd27b..4c2be8c 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -120,7 +120,7 @@ const luaX_token2str = function(ls, token) {
} else {
let s = luaX_tokens[token - FIRST_RESERVED];
if (token < R.TK_EOS) /* fixed format (symbols and reserved words)? */
- return defs.to_luastring(`'${s}'`);
+ return lobject.luaO_pushfstring(ls.L, defs.to_luastring("'%s'", true), defs.to_luastring(s));
else /* names, strings, and numerals */
return defs.to_luastring(s);
}
@@ -260,7 +260,7 @@ const txtToken = function(ls, token) {
case R.TK_NAME: case R.TK_STRING:
case R.TK_FLT: case R.TK_INT:
// save(ls, 0);
- return defs.to_luastring(`'${defs.to_jsstring(ls.buff.buffer)}'`);
+ return lobject.luaO_pushfstring(ls.L, defs.to_luastring("'%s'", true), ls.buff.buffer);
default:
return luaX_token2str(ls, token);
}