[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Fwd: Heritage of Lua syntax for multi-line strings and comments
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 24 Nov 2023 11:10:30 -0300
> instead of:
> `--[[[[[ third level styled text comment ]]]]]`
As Tom already pointed out, that creates some ambiguities if we try
to enclose text starting or ending with square bracktes.
> or
> `--['''[ third level styled text comment ]''']`
Compare: a = x[''] versus a = x[''[. We need some look-ahead to
distinguish them.
> or
> `--[...[ third level styled text comment ]...]`
Again, compare: a = x[...] versus a = x[...[.
That said, '=' is as good as any other character that cannot follow
'[' in regular Lua code. (Better yet if it cannot come before ']').
Well, its symmetry is also a plus:
[>>>] text [>>>] ?? [>>>[ text ]<<<]
[///] text [///] ?? [///[ text ]\\\]
[***[ text ]***] Sounds good
-- Roberto