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

Tagging of sections does not play well with validation template #46

Open
robertodr opened this issue Mar 26, 2019 · 5 comments
Open

Tagging of sections does not play well with validation template #46

robertodr opened this issue Mar 26, 2019 · 5 comments
Labels
bug Something isn't working lowprio Low priority stuff

Comments

@robertodr
Copy link
Contributor

The following is parsed by the grammar, but does not pass validation.

name<foo> {
   ... keywords ...
  .... sections ...
}

This totally slipped through the cracks and I am unsure how to solve it.

@robertodr robertodr added the bug Something isn't working label Mar 26, 2019
@bast
Copy link
Member

bast commented Mar 26, 2019

I am not sure I see the problem yet. Do you have an explicit example that should pass validation but does not? (maybe the above is an explicit example)

@robertodr
Copy link
Contributor Author

Yes, the above example fails with name<foo> section not recognized. The idea with tagging is too have multiple similar sections. They should all be validated in the same way and the tag should only have meaning for the final consumer. I think it will be enough to match section names with a regex, though how this will ripple through (if at all) I cannot foresee.

@robertodr
Copy link
Contributor Author

I think we need to touch all the recusrive functions to be tag-tolerant, but there's a little nasty twist.
For example, the rec_merge_ours function around here: https://github.com/dev-cafe/parselglossy/blob/master/parselglossy/validation_plumbing.py#L117
The set difference needs to be tolerant with respect to tagging (only strings enclosed by<> allowed), but only for sections, as tagged keyword make no sense, IMO.

I don't consider tagging to be an enormously important feature: it can be emulated by duplication in the validation template.

@bast bast added the lowprio Low priority stuff label Jul 18, 2019
@bast
Copy link
Member

bast commented Jul 18, 2019

The minimum would be a mention in docs and not support this.

We may consider implementing keyword/section "templates" which would help avoiding input template code repetition.

@robertodr
Copy link
Contributor Author

Still low priority, as there is not really a relevant use case so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lowprio Low priority stuff
Projects
None yet
Development

No branches or pull requests

2 participants