Skip to content

Commit

Permalink
Parse TypeWithConstraint SizeConstraint as the generalized Constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse07410 committed Dec 20, 2023
1 parent 1adb32d commit 1c56d4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion libasn1parser/asn1p_y.y
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,9 @@ optManyConstraints:
optSizeOrConstraint:
{ $$ = 0; }
| Constraint
| SizeConstraint
| SizeConstraint {
CONSTRAINT_INSERT($$, ACT_CA_SET, $1, 0);
}
;

Constraint:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests-asn1c-compiler/19-param-OK.asn1.+-E_-F
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Certificate ::= SIGNED{ SEQUENCE {

Name ::= SEQUENCE OF RelativeDistinguishedName

RelativeDistinguishedName ::= SET SIZE(1..MAX) OF IA5String (FROM("A".."Z" | "a".."z" | "0-9" | ",-."))
RelativeDistinguishedName ::= SET (SIZE(1..MAX)) OF IA5String (FROM("A".."Z" | "a".."z" | "0-9" | ",-."))

END
2 changes: 1 addition & 1 deletion tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.+-E_-F
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ModuleTestSequenceSimple { iso org(3) dod(6) internet(1) private(4)
DEFINITIONS IMPLICIT TAGS ::=
BEGIN

Programming ::= SEQUENCE SIZE(1..10) OF [0] IMPLICIT Fault
Programming ::= SEQUENCE (SIZE(1..10)) OF [0] IMPLICIT Fault

Fault ::= SET OF Error

Expand Down
6 changes: 3 additions & 3 deletions tests/tests-asn1c-compiler/42-real-life-OK.asn1.+-E_-F
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ BEGIN

LogLine ::= SEQUENCE {
line-digest IA5String,
varsets SEQUENCE SIZE(1..MAX) OF VariablePartSet,
varsets SEQUENCE (SIZE(1..MAX)) OF VariablePartSet,
...
}

VariablePartSet ::= SEQUENCE {
vparts SEQUENCE SIZE(0..MAX) OF VariablePart,
vparts SEQUENCE (SIZE(0..MAX)) OF VariablePart,
resolution ActionItem,
...
}

VariablePart ::= CHOICE {
vset SET SIZE(1..MAX) OF VisibleString,
vset SET (SIZE(1..MAX)) OF VisibleString,
vrange SEQUENCE {
from VisibleString,
to VisibleString,
Expand Down

0 comments on commit 1c56d4d

Please sign in to comment.