parslet icon indicating copy to clipboard operation
parslet copied to clipboard

Precedences in`infix_expression`

Open schuetzm opened this issue 4 years ago • 0 comments

It seems currently the precedences in infix_expression need to be > 0; when you use 0 for an operator, it fails to parse it correctly. As far as I can tell this is caused by the default value of current_prec = 1 in https://github.com/kschiess/parslet/blob/master/lib/parslet/atoms/infix.rb#L51. This could be set to 0, or even -Float::INFINITY, to support even negative precedences (which can come in handy when you want to add a low precedence operator and don't want to adjust all the existing precedences).

schuetzm avatar Sep 29 '20 16:09 schuetzm