You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general, ASN.1 supports multiple ranges in a constraint or combination of ranges and single value constraints.
However, rasn constraints support currently only a single constraint value per constraint type (excluding PermittedAlphabetConstraint).
This applies for constraint types that can have a multitude of single value and/or range value constraints applying into them at the same time, where the effective constraint value is not actually continuous and should be described as union.
The previous sample currently only notes the last constraint ("9..15"). Combining the values to the single size() call is not permitted.
Usually this is described with union ∪ or | syntax, so that all values are permitted from these.
If there are layers of types with different constraints, the effective constraint is intersection of all these constraints. Described with ∩ or ^ elsewhere as direct notation.
For most use-cases, the current functionality can be enough, but this should be noted some day.
It seems to be a non-trivial problem, if we want to do it mostly in compile-time.
PermittedAlphabetConstraint makes union currently on macro level, since it is easier for alphabets.
However, any additional intersections are not currently possible on compile-time as the constraint value is passed as static reference. Also proper runtime intersection is missing for this type.
Extensible constraint additions should be also noted for intersection/union support.
The text was updated successfully, but these errors were encountered:
In general, ASN.1 supports multiple ranges in a constraint or combination of ranges and single value constraints.
However,
rasn
constraints support currently only a single constraint value per constraint type (excludingPermittedAlphabetConstraint
).This applies for constraint types that can have a multitude of single value and/or range value constraints applying into them at the same time, where the effective constraint value is not actually continuous and should be described as union.
For example:
The previous sample currently only notes the last constraint ("9..15"). Combining the values to the single
size()
call is not permitted.Usually this is described with union
∪
or|
syntax, so that all values are permitted from these.If there are layers of types with different constraints, the effective constraint is intersection of all these constraints. Described with
∩
or^
elsewhere as direct notation.For most use-cases, the current functionality can be enough, but this should be noted some day.
It seems to be a non-trivial problem, if we want to do it mostly in compile-time.
PermittedAlphabetConstraint
makes union currently on macro level, since it is easier for alphabets.However, any additional intersections are not currently possible on compile-time as the constraint value is passed as static reference. Also proper runtime intersection is missing for this type.
Extensible constraint additions should be also noted for intersection/union support.
The text was updated successfully, but these errors were encountered: