Mark reductions as fragile based on their final properties

We previously maintained a set of individual productions that were
involved in conflicts, but that was subtly incorrect because
we don't compare productions themselves when comparing parse items;
we only compare the parse items properties that could affect the
final reduce actions.
This commit is contained in:
Max Brunsfeld 2017-07-21 09:54:22 -07:00
parent 7d9d8bce79
commit cbdfd89675
6 changed files with 165 additions and 137 deletions

View file

@ -4,8 +4,8 @@ Unresolved conflict for symbol sequence:
Possible interpretations:
1: (math_operation expression '+' expression) • '+' …
2: expression '+' (math_operation expression '+' expression)
1: expression '+' (math_operation expression '+' expression)
2: (math_operation expression '+' expression) • '+' …
Possible resolutions:

View file

@ -4,9 +4,9 @@ Unresolved conflict for symbol sequence:
Possible interpretations:
1: (sum expression '+' expression) • '*' …
2: expression '+' (product expression • '*' expression)
3: expression '+' (other_thing expression • '*' '*')
1: expression '+' (product expression • '*' expression)
2: expression '+' (other_thing expression • '*' '*')
3: (sum expression '+' expression) • '*' …
Possible resolutions:

View file

@ -292,7 +292,7 @@ describe("Parser", [&]() {
"(number) "
"(math_op (number) (math_op (number) (identifier)))))))");
AssertThat(input->strings_read(), Equals(vector<string>({"123 || 5 ", ";"})));
AssertThat(input->strings_read(), Equals(vector<string>({"123 || 5 "})));
});
});