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

refactor(parse_spec): massive reorganization #37

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Conversation

StoneyJackson
Copy link
Member

@StoneyJackson StoneyJackson commented Feb 21, 2025

The authors of this PR...

  • Sign off on the DCO.
  • License their changes under the project's license.

Playing around with the organization of parse_spec.

* Rename errors
* Factor out each validator
Some validators are stateful across rules
(e.g., check_for_duplicate_names). Some are not.
If validators are assumed to process a single rule,
then to allow for stateful validators, validators
must be objects. This imposes a more complex protocol
for using validators.

Instead, if we move the responsibility of processing
all rules to each validator, then validators can
be represented by a simple function that takes an
iterable of rules, and returns a list of errors.

So that's what this commit does. Now all lexvalidate
validators are functions that each process all the
rules and return a list of errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Revising
Development

Successfully merging this pull request may close these issues.

1 participant