lua-users home
lua-l archive

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


1. When I run your code using LPeg 0.12 exactly as given, i.e. without
uncommenting the offending line, it operates as I think you expect it to.
2. I regard the `C` patterns in Lua as advanced, only to be used when
the simpler `/` cannot do what you need.

When I taught myself LPeg, I wrote the following primer:

http://htmlpreview.github.io/?https://github.com/dlaurie/lua-notes/blob/master/lpeg-brief.html

You might find it useful to look at it too.

2014-04-13 0:09 GMT+02:00 Christophe Devalland <christophe.devalland@gmail.com>:
> Thanks Pierre-Yves,
>
> 2014-04-12 22:31 GMT+02:00 Pierre-Yves Gérardy <pygy79@gmail.com>:
>
>> Replace `Cf(Exp,parenthese)` with `(Exp/parenthese)`, you'll get the
>> expected result.
>
>
> I tried this but there was no difference :
> print(match(Grammaire,'1+(5+4)'))
> gives also :
> 1    +    par{5}
>