lua-users home
lua-l archive

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

The reference manual contains the syntax rule

   block ::= [label] { stat [';'] }

while the parser itself contains (both implicitly and explicitly)

   block ::= chunk


   chunk ::= { [label] stat [';'] }

As far as I can see (taking the rest of the grammar into
consideration), this makes the manual version overly restrictive,
as it would preclude something like:

|label1| x=1
|label2| x=2

Am I missing something here?

(I also wonder about the reference manual definition

   chunk ::= {stat} [ret]

Wouldn't this preclude the use of semicolons, which is
explicitly permitted in the block definition?)

This may of course be unnecessary nitpicking...
(Although it would be nice if it were possible to make
a parser based solely on the information in the reference
manual... :)


  Magnus Lie Hetland      (magnus at hetland dot org)

 "Reality is what refuses to disappear when you stop
  believing in it"                 -- Philip K. Dick