asn1ate icon indicating copy to clipboard operation
asn1ate copied to clipboard

restricted_integer_type range constraint

Open karlsv opened this issue 8 years ago • 2 comments

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.

karlsv avatar Nov 15 '17 14:11 karlsv

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!

kimgr avatar Nov 15 '17 15:11 kimgr

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

karlsv avatar Nov 16 '17 09:11 karlsv