[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A know this is a syntactically valid Lua expression.Can someone give me a written parse for it?
- From: v <v19930312@...>
- Date: Tue, 30 Jul 2019 01:43:36 +0300
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>