-
Notifications
You must be signed in to change notification settings - Fork 12
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
genders file to include other files #23
Comments
I hear that this concept was discussed early in the creation of genders. It's a good idea that would at least cut down on mistakes. Pushback at the time, reasonably, was: "feature-creep". I'm going to add this to the TODO list and pick it up when I have cycles. |
Thanks. |
One comment/thing to ponder, if an old version of genders parsed
I think it would see a node named "include" and an attribute named "/etc/genders_c1". Perhaps it should be:
So atleast the include directive is not read b/c its a comment in earlier versions. Or are we just introducing an alternate unexpected behavior so it doesn't matter either way? |
Least surprise might be to have the new include directive cause a parse error in old genders versions, if that's even possible - looks like we are pretty liberal about what constitutes a valid line of input. |
I agree that it should fail visibly when using an older version of genders. Whoever used the include probably did it on purpose and should have a strong indication of badness rather than some genders silently disappearing if include is interpreted as a comment. Seems like a 3-word line breaks the parser. Maybe something like
|
I'm not sure there is a way to make this pretty, but would it be useful to introduce a special directive prefix character so that future versions of the library can add directives beyond "include", and unknown directives can be detected and called out as such? For example, maybe use
then in new parser
as opposed to
|
I've had good results (and more easily debugged results) just concatenating various input pieces with application logic into a single input file before parsing genders. |
If you go with "include genders /etc/gendres_c1" syntax, for completeness consider |
Would be great to have the ability for nested genders files...
eg. /etc/genders to be
This would allow us to have 1 genders file manage multiple clusters.
The text was updated successfully, but these errors were encountered: