lua-users home
lua-l archive

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


On Mon, 2019-07-29 at 15:32 -0700, Carl Glassberg wrote:
> Hello:
> 
> This is an example of a syntactically valid legal expression in Lua,
> taken from the PEGTL github grammar for Lua, by Dr. Colin Hirsch and
> Daniel Frey (I hope they don't mind me repeating it here):
>    ( a * b ).c()[ d ].e:f()

( a * b ) Multiply variable `a` by variable `b`.
.c        Take field named `'c'` (string "c" without quotes) from
result of previous expression. Make sense if it was overloaded.
()        Call that field.
[ d ]     Take field at index stored in variable `d` from result of
last call.
.e        Same as `.c` before, take field named `'e'` from result of
last indexing.
:f()      Take entity at index `f` and call it with single argument
being result of last expression.

-- 
v <v19930312@gmail.com>