lua-users home
lua-l archive

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


Klaas-Jan Stol wrote:

Mike Pall wrote:

Hi,

Klaas-Jan Stol wrote:
Is the new syntax overview of 5.1 already published? If so, could you give me a link? I could try to insert the new syntax elements into my parser.


There is no official statement out (yet). And it's still
subject to change (but nothing major I think).

Short summary of the syntax differences between Lua 5.0 and 5.1:

- New right-assoc prefix operator SIZ: '*' expr
- New left-assoc infix operator MOD: expr '%' expr
- New VARARG expression: '...'
- Extended long strings: '[' '='* '[' longstring ']' '='* ']'
- Extended long comments: '--' '[' '='* '[' longcomment ']' '='* ']'
- The number of '=' must match up.
- Long strings and comments cannot be nested in 5.1.

So, just to make sure (before I start implementing the whole thing), you can't do:

[=[I said: [==[Hello World]==] to him]=]

But, instead: [[, [=[, [==[, [===[, etc. are just opening "quotes" of long strings, (and ]], ]=], ]==], etc are closing quotes of long strings). Right?

Klaas-Jan