lua-minify
lua-minify copied to clipboard
require not working
Coming from LÖVE, having require in your code throws an issue:
require "test"
luajit: minify.lua:205: file<1:3>: Bad symbol `´` in source.
stack traceback:
[C]: in function 'olderr'
minify.lua:205: in function 'error'
minify.lua:406: in function 'CreateLuaTokenStream'
minify.lua:414: in function 'CreateLuaParser'
minify.lua:3206: in main chunk
[C]: at 0x00401f80
luajit 2.1
That's another shortcoming of the current parser - it doesn't handle this special case of function invocation (which only works with a single argument that's either a string literal or a table constructor), see e.g. https://www.lua.org/pil/5.html.
The more verbose / 'standard' syntax will work: require("test")
Regards, NiteHawk
Interesting enough: functionargs() already arranged for CallType = 'StringCall'.
So it actually takes very little to support "string calls", see 7f607a08.
Regards, NiteHawk