[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: ¿Error in the reference manual?
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Wed, 10 Mar 2010 17:07:48 +0100
Hello,
If I understand it properly, according to the grammar at the end of
the reference manual,
the following statement should be legal (although it isn't in practice):
a = function() break end
http://www.lua.org/manual/5.1/manual.html#8
Here are the relevant entries:
function ::= `function´ funcbody
funcbody ::= `(´ [parlist] `)´ block `end´
block ::= chunk
chunk ::= {stat [`;´]} [laststat [`;´]]
laststat ::= `return´ [explist] | `break´
I'm a self thought programmer, so my grasp of theoretical CS is a bit
hazy. Does the bug lie in the spec or in my mind?
Cheers,
-- Pierre-Yves