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 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 theSyntaxMap
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.