Re: Completeness of refman precedence table
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Completeness of refman precedence table
 
- From: Roberto Ierusalimschy <roberto@...>
 
- Date: 2011年12月11日 12:27:38 -0200
 
> I've read the refman several times but strangely I only noticed
> recently that the precedence table in section 3.4.7 (I'm referring
> to 5.2.0, but the table is the same in 5.1.4) doesn't mention the
> following operators:
> 
> function call "()"
> array indexing "[]"
> field access "."
> method call ":"
> 
> Not that this prevented me to be confused writing code, but somehow
> I subconsciously applied java/C/C++-like precedence rules for those
> and got away with it (I suppose that those operators have the
> highest precedence in Lua too).
> 
> I'm I missing something? Is there a reason to omit them?
The grammar gives the precedence for them. The other operators all
apply to 'exp'; these apply to a 'prexifexp', which cannot contain
binary or prefix operators.
-- Roberto