lua-users home
lua-l archive

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


Thoughts on using Lua 5.3's new operators in LPeg?

patt1 + patt2    -->    patt1 | patt2
patt1 - patt2    -->    patt1 ~ patt2
-patt    -->    ~patt

I know * was chosen for "concatenating patterns" because it closer
resembles the dot operator, but imo it'd make sense to use + for that.

Anyway, this is what I'd prefer -- what do you other people want? :-)

The biggest criticism I see against this is that it would be a bad
move to mess with a an already established set of operators.

Should it change at all?

PS: I was trying to figure out a way that << or >> could be used for captures.