docs: add note for bullet

This commit is contained in:
Amaan Qureshi 2024-06-23 13:35:10 -04:00
parent 6ec478c1e9
commit 34c4784ac5
No known key found for this signature in database
GPG key ID: E67890ADC4227273

View file

@ -586,6 +586,10 @@ Possible resolutions:
4: Add a conflict for these rules: `binary_expression` `unary_expression`
```
Note: The • character in the error message indicates where exactly during
parsing the conflict occurs, or in other words, where the parser is encountering
ambiguity.
For an expression like `-a * b`, it's not clear whether the `-` operator applies to the `a * b` or just to the `a`. This is where the `prec` function [described above](#the-grammar-dsl) comes into play. By wrapping a rule with `prec`, we can indicate that certain sequence of symbols should *bind to each other more tightly* than others. For example, the `'-', $._expression` sequence in `unary_expression` should bind more tightly than the `$._expression, '+', $._expression` sequence in `binary_expression`:
```js