Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use raw grammar for production matching #449

Merged
merged 2 commits into from
May 19, 2022
Merged

Use raw grammar for production matching #449

merged 2 commits into from
May 19, 2022

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented May 19, 2022

When building the SDO map we look for matching productions. Prior to this PR that's done by matching on the output of grammarkdown. That duplicates logic and also fails to handle cases where nodes are wrapped in <ins>, etc.

This PR changes that logic to operate on the raw grammarkdown nodes, which hide the wrapping HTML tags where we don't need to worry about them, thus deduplicating some logic and also fixing #448.

This requires associating the generated HTML elements with the underlying Grammarkdown objects. For now we do this in a slightly hacky way where we index two lists of RHSes and assume they agree, which works fine. It would be better to keep track of this information when creating the nodes in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant