Skip to content

Inverted precedence parsing range operator #34483

@gafter

Description

@gafter

The expression a * ..b should produce a syntax error (as * binds tighter than ..) but the parser produces a tree with precedence inversion and no diagnostics.

I believe the correct fix is to use different precedence for a..b and ..b and a.., which should be at precedence (1) between shift and additive, (2) unary, and (3) primary, respectively. The expression .. should also be a primary.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions