Skip to content

Conversation

wravery
Copy link
Contributor

@wravery wravery commented Jan 27, 2019

PEGTL has a default control template class (normal) which raises parse_error exceptions using the type name of the required rule that was not matched. Some of the types in my GraphQL grammar were ambiguous and hard to map to the grammar rule that expected them.

I refactored the grammar to use a custom control template and I encapsulated all of the must or if_must rules which are the only valid match in those locations with *_content rules that can be unambiguously specialized in the control template class.

@wravery wravery merged commit 1d17e27 into master Jan 27, 2019
@wravery wravery deleted the exceptions branch January 27, 2019 23:08
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