pest
pest copied to clipboard
PrecClimber prefix/suffix support
It would be nice if PrecClimber, or a variant of it, could have support for prefix/suffix operators. Currently it requires copying over the code and implementing it yourself, which while possible, increases the chance for bugs and the difficulty on the library user.
Possible API for a new climber:
- Add a new operator type,
Infix,PrefixandSuffixor similar - Add
prefixandpostfixclosure parameters toclimb Prefixdoesn't expect an shsPostfixdoesn't expect an rhs
With this new climber, one could easily parse a syntax roughly like
expr = {
prefix_ops* ~ target ~ suffix_ops* ~ (infix_op ~ prefix_ops* ~ target ~ suffix_ops*)*
}