lua-users home
lua-l archive

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

> 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