Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for
CLASS
default syntax.This complements the already implemented defined syntax (through the construct
WITH SYNTAX {}
).Class instances with no defined syntax, must be implemented using the default syntax.
The default syntax follow the format:
"{" FieldSetting "," * "}"
, whereFieldSetting
isPrimitiveFieldName Setting
.A
PrimitiveFieldName
is a reference to a class element, andSetting
is a value, type, or object.FieldSetting
's can appear in any order in the class instance definition.Fixes the compilation of ASN.1 definitions with classes without
WITH SYNTAX {}
, such as the one in issue #171.A new test (164) was added.
Current issue: tests related with the
18-class-OK.asn1
file currently fail.There are several reasons, and they only came to light now because the proposed PR now actually handles the fields inside of classes with default syntax.
{ PosPair | NegPair }
. Nokalva's playground also cannot compile this file for the same reason;PosPair
andNegPair
as some types,asn1c
still cannot handle the construct{ PosPair | NegPair }
;0
defined for&result-if-error
cannot be handled because&ResultType
can be any type (withNULL
as default).Where issue
1.
should be fixed by changing the ASN definition itself itself,2.
should be fixed inasn1c
. This last one is probably related with this warning message, where mostFieldSpec
's are not yet handled.About
3.
, I'm not sure if setting0
is correct if the underlying type can be any.I did not yet check how hard or easy it is to fix
2.
, and I don't know if I'll have the time to look into it.In the meantime, we can modify/remove
18-class-OK.asn1
to pass the tests.Followed X.681 (2021) standard.