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

restricted_integer_type range constraint #57

Open
karlsv opened this issue Nov 15, 2017 · 2 comments
Open

restricted_integer_type range constraint #57

karlsv opened this issue Nov 15, 2017 · 2 comments

Comments

@karlsv
Copy link

karlsv commented Nov 15, 2017

shouldn't restricted_integer_type, at line 275 in parse.py, have the possibility for value_range_constraint?
I edited mine to:
restricted_integer_type = INTEGER + braced_list(named_number) + Optional(value_range_constraint | single_value_constraint, default=None)

and it resolved an error I had and seems to work fine.
Please correct me if I'm wrong.

@kimgr
Copy link
Owner

kimgr commented Nov 15, 2017

No, I think that's fine!

The current grammar is a little broken with regards to constraints, and I have a branch somewhere with a better generalization. But doesn't appear to move forward very quickly, so this is a good start.

Have you run the test suite after your change without problems? Could you add a test case somewhere with a few syntax examples, so this is covered for the future? And with all that in place, could you post a pull request?

Thanks!

@karlsv
Copy link
Author

karlsv commented Nov 16, 2017

Sure, I haven't run the test suite yet, but I'll get to that.
I also found that constraints can be on the form
PathDeltaTime ::= INTEGER { tenMilliSecondsInPast(1) } (1..65535, ...)
With an ellipsis after the range, but I have no idea what that means yet. If I find out I could try to fix support for that too.
For reference I'm working with the ITS CAM/DENM specification, for which the ASN1 can be found on
asn1-playground.oss.com
with direct links:
CAM
DENM
maybe some of this could be a test case

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

No branches or pull requests

2 participants