lua-users home
lua-l archive

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


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.

That's all (I hope).

Bye,
    Mike


Thanks for the update. It seems it's pretty easy to add these new syntactic elements:

- '*' <expr> is similar to 'not' <expr>, do you think they have the same precedence? (this is in, no conflicts here) - VARARG as an alternative to <expr> is no problem either (no conflicts here) - the binary '%' operator is no problem at all, just yet another binary operator (I assume same precedence as '/' and '*' ?) - the extended long strings/comments should be something to be kept track of in the scanner, didn't try that stuff yet. Should be no problem, I think.

Thanks,

Klaas-Jan