lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, 16 Dec 2018 at 19:51, Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
> Let's introduce special "ignore me" symbol in Lua syntax.
> (The description below assumes this symbol is the backtick)
>
> Single occurrence of "ignore me" symbol means that this symbol
> must be ignored (excepting inside literal strings)
> without splitting the current lexem:
>
> A sequence of two (or more) "ignore me" symbols means
> part of line (block) must be ignored.
> The block is terminated by either end-of-line
> or the same amount ("the depth") of backticks.
> Syntactically it should be treated as lexem separator.
>

I personally would prefer something like the Java annotation syntax:

@name( property1='value1', ... )

Where the '( property1='value1', ... )' bit is optional

Of course some folks might prefer the () to be {} so that this looks
like a Lua table.

So one could have single word annotations, or provide extra attributes.

As with any annotation system, if the parser doesn't recognize it,
they should be skipped.

The syntax for closeable local declarations can just use this
mechanism instead of the current proposed syntax.