aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-08-18 16:01:55 +0200
committerBjörn Gustavsson <[email protected]>2014-09-01 14:37:14 +0200
commita1260b2ffa60581ce3af0728320b593cca3fd7b0 (patch)
tree2b19fb0a06cecc712cac71fa398b30cab58335bb /lib/asn1/test/asn1_SUITE_data
parent5095efaac2920677510971f08908e97f379c7c3f (diff)
downloadotp-a1260b2ffa60581ce3af0728320b593cca3fd7b0.tar.gz
otp-a1260b2ffa60581ce3af0728320b593cca3fd7b0.tar.bz2
otp-a1260b2ffa60581ce3af0728320b593cca3fd7b0.zip
Correct expansion of parameterized types
Attempting to compile: SomeType{SOME-CLASS-NAME, SOME-CLASS-NAME:SomeSet} ::= ... SEQUENCE { something SOME-CLASS-NAME.&id({SomeSet}) } would crash the compiler, because the actual parameter for SOME-CLASS-NAME was not substituted into the governor for the SomeSet parameter. While we are at it, combine the functionality of is_class/2 and get_class_def/2 (eliminating is_class/2). Most callers call both function.
Diffstat (limited to 'lib/asn1/test/asn1_SUITE_data')
-rw-r--r--lib/asn1/test/asn1_SUITE_data/ParamBasic.asn122
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/ParamBasic.asn1 b/lib/asn1/test/asn1_SUITE_data/ParamBasic.asn1
index 491bdf8956..68fc782f33 100644
--- a/lib/asn1/test/asn1_SUITE_data/ParamBasic.asn1
+++ b/lib/asn1/test/asn1_SUITE_data/ParamBasic.asn1
@@ -20,4 +20,26 @@ T21 ::= General2{PrintableString}
T22 ::= General2{BIT STRING}
+
+--
+-- Test a class parameter that is the governor for another parameter.
+--
+
+AlgorithmIdentifier{ALGORITHM-TYPE, ALGORITHM-TYPE:AlgorithmSet} ::=
+ SEQUENCE {
+ algorithm ALGORITHM-TYPE.&id ({AlgorithmSet}),
+ type ALGORITHM-TYPE.&Type ({AlgorithmSet}{@algorithm})
+ }
+
+AnAlgorithm ::= AlgorithmIdentifier{ SIGNATURE-ALGORITHM,
+ { {KEY 1 CONTAINING INTEGER} |
+ {KEY 2 CONTAINING BOOLEAN} } }
+
+SIGNATURE-ALGORITHM ::= CLASS {
+ &id INTEGER UNIQUE,
+ &Type
+} WITH SYNTAX {
+ KEY &id CONTAINING &Type
+}
+
END