-
Notifications
You must be signed in to change notification settings - Fork 1
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 winnow instead of nom #9
base: master
Are you sure you want to change the base?
Conversation
Hi, Thank you for contributing ! I'm not against switching to winnow, especially if it improves error reporting which is not great at the moment. However please also consider performance while refining this PR: I ran a test in which I feed a file containing Thanks ! |
Found the issue. An error that needed a string made me copy a subslice of the input, and the framework just ran with it. Removing this temporarily for refactoring, the performance drops back to the same range:
|
So there is a entire parser for nodelists, with precedence climbing and stateful parsing, but reading the |
Mmmh, I'm not sure what you mean exactly ? Clustershell uses a mix of ini and yaml files which we parse with Rust crates. The only use of Clustershell allows you to configure dynamic group sources for which groups and their members are generated dynamically by calling commands that the user provides in configuration files. By default clustershell ships with a configuration file defining a dynamic group source that calls As part of the tests we validate that the default configuration file of clustershell is interpreted correctly. |
That is exactly it. I had no idea the default group configuration from the
Makes a lot more sense with your explanation of why I was seeing sed calls being made. Not convinced this is good practice from |
Clustershell has been able parse static group source definition in yaml files for a while now (see the Speaking of backwards compatibility, I think the current behaviour for non-existing group/sources was implemented to match clustershell (only return an error for non-existing sources). Do you see a strong rationale for changing this ? |
No I do not. My rationale was to go bottom-up for errors, as I wanted to make sure parse errors include more information, and I though the error was missing and not omitted by choice. If you are telling me this is the latter, it will be reverted. This is going really slow because I am spread thin at the moment, sorry. |
Changes the parser combinator library to use the more actively maintained winnow fork of nom. The changes in winnow allow for lesser nesting, and better error reporting - this PR aims to enable those features for the nodeset parsing.