lua-users home
lua-l archive

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


2014-12-14 21:39 GMT+02:00 Sam Putman <atmanistan@gmail.com>:

> expr = token + ( V"group" + V"factor" + V"term")
-- semicolon needed here
> group = P"(" * V"expr"^0 * P")";
> factor = #token * V"expr" * (P"*" + P"/") * V"expr";

> This program fails with "rule 'expr' may be left recursive".

If `expr` is not `token` or `group`, it tries `factor`.
The rule for `factor` invokes V"expr" before any
input has been consumed.