[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Idea: 'function' keyword optional when preceded by 'local'
- From: pansz <pan.shizhu@...>
- Date: Thu, 7 Jul 2011 15:07:15 +0800
On Thu, Jul 7, 2011 at 3:32 AM, David Hollander <dhllndr@gmail.com> wrote:
>> would require a lookahead parser
> Would it?
The syntax for function definition is
function ::= function funcbody
funcbody ::= `(´ [parlist] `)´ block end
you need to lookahead parse until the "end" to know that this is a funcbody.
() brackets can be a valid statement itself, without "end".