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

Add loadValidSyntaxesFromDir #192

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Add loadValidSyntaxesFromDir #192

merged 1 commit into from
Jun 10, 2024

Conversation

kquick
Copy link
Contributor

@kquick kquick commented Jun 7, 2024

The existing loadSyntaxesFromDir function is an all-or-nothing function: a single invalid file results in a error and no loaded syntaxes.

This adds the loadValidSyntaxesFromDir parallel function which is resilient against individual syntax file load failures. It returns a map of the failure messages, and the SyntaxMap that is created from all the successful parsing.

While the implementation is fairly trivial when implemented here, it makes use of local functions in this module and existing imports; duplicating that internal functionality and set of imports externally are not insignificant, thus the tradeoff against the expanded API surface is probably justified.

The loadSyntaxesFromDir function is an all-or-nothing function: a single invalid
file results in a error and *no* loaded syntaxes.

This adds the loadValidSyntaxesFromDir, which is resilient against individual
syntax file load failures.  It returns a map of the failure messages, and the
SyntaxMap that is created from all the successful parsing.
@jgm jgm merged commit d9fa709 into jgm:master Jun 10, 2024
6 checks passed
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.

2 participants