Skip to content

search: add test values for grammar spec and heuristic parser

Administrator requested to merge rvt/separate-heuristic-tests into master

Created by: rvantonder

I want our parser's heuristic choices to be visible and tractable. I'm sure that we'll want to add heuristic additions in future, and explicit test values will help track the differences. This PR adds a relation for existing parser tests and the new heuristic additions in #9494 and #9620.

For example, the test output will now quote leaf nodes (e.g., search patterns) so we can distinguish the difference. Here's a representative test introduced in this PR that illustrates how the heuristic is treating parentheses literally, as a sequence of the strings (((a b c))) instead of a group that can be reduced in the original grammar spec.

Input:         "(((a b c))) and d",
WantGrammar:   Spec(`(and (concat "a" "b" "c") "d")`),
WantHeuristic: Diff(`(and (concat "(((a" "b" "c)))") "d")`),

Merge request reports

Loading