xsawyerx / guacamole

Guacamole is a parser toolkit for Standard Perl. It provides fully static BNF-based parsing capability to a reasonable subset of Perl.
https://metacpan.org/pod/Guacamole
20 stars 8 forks source link

Fix expression precedence parsing #32

Closed vickenty closed 4 years ago

vickenty commented 4 years ago

Each precedence level is represented by a separate grammar rule. This way we can unambiguously encode precedence and fixity of all operators.

Rearrange all operators into four groups based on their precedence.

NonBrace.* expressions now include OpComma, to parse parameter lists for operators like map.

NonBraceExpression was renamed to BlockLevelExpression. BlockLevelExpressiion and NonBraceExpression have different rules around commas, to allow { push @a, 1 }, but to disallow {1, 2} (to avoid block/anonhash abiguity).

Fixes #28

xsawyerx commented 4 years ago

Amazing! I need to rebase this from master. I'll do that tomorrow. Then I'll rebase #34 from that.