lua-users home
lua-l archive

Re: Lua 5.1: Question on how the Lua parser evaluates bodies

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


Hello Luiz Henrique,
you are right with block() , I am sorry.
I get this in Lua 5.1:
C:\agena\srclua>lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> do
Entering block
Left block
>>    print("Lua")
Entering block
Left block
>> end
Entering block
Left block
Lua
Alex
Luiz Henrique de Figueiredo wrote:
I noticed that the Lua 5.1 parser seems to call the body() procedure
multiple times when parsing statements that are part of a Lua body, for
example statements in a `then`, `else` or `do` body.
body() is for parsing function bodies:
 /* body -> `(' parlist `)' chunk END */
Perhaps you mean block():
 /* block -> chunk */

AltStyle によって変換されたページ (->オリジナル) /