Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require not working #7

Open
martin-braun opened this issue Feb 23, 2018 · 2 comments
Open

require not working #7

martin-braun opened this issue Feb 23, 2018 · 2 comments

Comments

@martin-braun
Copy link

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

@n1tehawk
Copy link

n1tehawk commented Apr 7, 2018

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

@n1tehawk
Copy link

Interesting enough: functionargs() already arranged for CallType = 'StringCall'.
So it actually takes very little to support "string calls", see 7f607a0.

Regards, NiteHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants