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

Lua long strings/comments [[ [=[ [==[ etc #948

Closed
justarandomgeek opened this issue Feb 20, 2020 · 3 comments
Closed

Lua long strings/comments [[ [=[ [==[ etc #948

justarandomgeek opened this issue Feb 20, 2020 · 3 comments
Milestone

Comments

@justarandomgeek
Copy link

Lua uses double brackets [[ ]] and extended double brackets with any number of = in them [=[ [==[ [===[ [====[ ]====] ]===] ]==] ]=] etc to designate multiline strings, and the same open bracket preceded immediately by -- (like --[[ --[=[ etc) for multi-line comments. I assume you can't do an infinitely-long bracket ligature, but maybe some reasonable sized set of them (up to four, perhaps?) could be joined up?

@tonsky
Copy link
Owner

tonsky commented Feb 22, 2020

Thanks, I’ll see what I can do. Practice shows that joining brackets is not a good idea. But maybe brackets with equal sign could be safe. I haven’t seen this syntax anywhere else

@justarandomgeek
Copy link
Author

Yeah, Lua has some... interesting quirks in the language. The long brackets are quite nice though, because they allow you to correctly quote anything without escaping, by simply using the next longer one than any close-bracket-like text in the string being quoted (or commented)! I've seen them up to six equals long in the wild, but rarely. Zero and one equals is probably 99% of all of them.

@tonsky tonsky added this to the 4 milestone May 16, 2020
@tonsky
Copy link
Owner

tonsky commented May 18, 2020

Should be better in v4

@tonsky tonsky closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants