From 34c4784ac54f8d637784c2fdc66125dfce73e523 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 23 Jun 2024 13:35:10 -0400 Subject: [PATCH] docs: add note for bullet --- docs/section-3-creating-parsers.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/section-3-creating-parsers.md b/docs/section-3-creating-parsers.md index 6439abc6..afd08fbc 100644 --- a/docs/section-3-creating-parsers.md +++ b/docs/section-3-creating-parsers.md @@ -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