Skip to content

Commit

Permalink
Fix typo in patterns-and-pitfalls.md (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatBlockyPenguin authored Sep 20, 2024
1 parent cb3decc commit 5137258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/patterns-and-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Note that the rule for the lower precedence operators (`+` and `-`) invokes the

#### 🐍 Ambiguous recursion

Notice that in the arithmetic grammar above, `mulExp` appears on the right hand side of all of `addExp`'s cases. Be careful that you don't write rules that are "ambiguously recursive", e.g. `addExp = addExp "+" addExp`. If you write your grammar like this, a reader can't tell whether `+` is left-associative or right-associative. (In Ohm, you will actually get a right-assiciative parse — see [#56](https://github.com/ohmjs/ohm/issues/56) for details.)
Notice that in the arithmetic grammar above, `mulExp` appears on the right hand side of all of `addExp`'s cases. Be careful that you don't write rules that are "ambiguously recursive", e.g. `addExp = addExp "+" addExp`. If you write your grammar like this, a reader can't tell whether `+` is left-associative or right-associative. (In Ohm, you will actually get a right-associative parse — see [#56](https://github.com/ohmjs/ohm/issues/56) for details.)

## Semantics

Expand Down

0 comments on commit 5137258

Please sign in to comment.