-
Notifications
You must be signed in to change notification settings - Fork 55
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
Indexing string literals #48
Comments
Should be fixed by #63 $ npm i git+https://github.com/Ayplow/luamin.git
+ luamin@1.0.4
$ npx luamin -c "('abc'):match('a')"
('abc'):match('a') |
Now I realize there was another problem related to indexing of string literals that I failed to mention: the minifier throws a syntax error for |
This is an issue with luaparse#24. |
This is getting farther from the original topic, but the string literal indexing is part of a larger issue. For all except table and function literals, Luamin doesn't recognize that any literal must be enclosed with parentheses in order to be indexed or have a method called on it:
If each of these lines is supplied separately to Luamin, there is a syntax error or the parentheses around the literal are removed, except with method calls on table and function literals. |
Currently luamin converts
('abc'):match('a')
to'abc':match('a')
. This results in a syntax error ("')' expected near ':'"): a string has to be enclosed in parentheses for it to be indexed. (Actually, the expression could be reduced to('abc'):match'a'
, but perhaps that's best avoided.)The text was updated successfully, but these errors were encountered: