Skip to content

Commit

Permalink
Fix ambiguity in pattern matching rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Evans committed Oct 12, 2024
1 parent 4cca41b commit 7ffb141
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions bootstrap/src/hmc/Grammar.hmh
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ include hocc

neutral pExpr_Exprs < pComma
neutral pPattern_Constr < pAs, pComma, pColonOp, pEqOp
neutral pPatternsTl_epsilon < pAs, pComma, pColonOp, pEqOp

# Keywords.
token AND "and" of token_simple prec pAnd
Expand Down Expand Up @@ -652,7 +651,7 @@ include hocc
| "(" Pattern ":" TypeExpr ")"
| Pattern "|" Pattern prec pEqOp
| ModulePathOrConstr Pattern prec pPattern_Constr
| Pattern "," Pattern PatternsTl
| Pattern "," Pattern prec pComma
| "[" Pattern ListPatternTl "]"
| Pattern "::" Pattern prec pColonOp
| "[|" Pattern ListPatternTl "|]"
Expand All @@ -665,11 +664,6 @@ include hocc
| ModulePathOrConstr "." RecordPattern
-> Xxx

nonterm PatternsTl of xxx ::=
| "," Pattern PatternsTl
| epsilon prec pPatternsTl_epsilon
-> Xxx

nonterm RecordPattern of xxx ::=
| "{" Field ":" TypeExpr "=" Pattern RecordPatternTl "}"
| "{" Field ":" TypeExpr RecordPatternTl "}"
Expand Down

0 comments on commit 7ffb141

Please sign in to comment.