aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_per.erl
diff options
context:
space:
mode:
authorKenneth Lundin <[email protected]>2012-06-08 13:26:41 +0200
committerKenneth Lundin <[email protected]>2012-06-08 13:27:40 +0200
commitb4b4c6299d3926e55b042ea45f55adaeec41cb6f (patch)
tree23fb9c48a109397a4aa9bd68b70a07a6cd9cf086 /lib/asn1/src/asn1ct_gen_per.erl
parent9cfeeb9b7e66a3345cbc0e5b4b634cb5965635fc (diff)
parentbe01ab6d2cad9d5b139b36c79b1c7addd57d5265 (diff)
downloadotp-b4b4c6299d3926e55b042ea45f55adaeec41cb6f.tar.gz
otp-b4b4c6299d3926e55b042ea45f55adaeec41cb6f.tar.bz2
otp-b4b4c6299d3926e55b042ea45f55adaeec41cb6f.zip
Merge branch 'kenneth/asn1/multiple_extaddgroup/OTP-10058' into maint
* kenneth/asn1/multiple_extaddgroup/OTP-10058: Add support for multiple ExtensionAdditionGroups
Diffstat (limited to 'lib/asn1/src/asn1ct_gen_per.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 59b4b3d261..5f42eacbdc 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -1405,19 +1405,21 @@ get_object_field(Name,ObjectFields) ->
%% have been specified within a SEQUENCE, therefore we construct a fake sequence type here
%% so that we can generate code for it
extaddgroup2sequence(ExtList) ->
- extaddgroup2sequence(ExtList,[]).
+ extaddgroup2sequence(ExtList,0,[]).
-extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],Acc) ->
+extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],ExtNum,Acc) ->
Number = case Number0 of undefined -> 1; _ -> Number0 end,
{ExtGroupComps,['ExtensionAdditionGroupEnd'|T2]} =
lists:splitwith(fun(Elem) -> is_record(Elem,'ComponentType') end,T),
- extaddgroup2sequence(T2,[#'ComponentType'{
- name='ExtAddGroup',
- typespec=#type{def=#'SEQUENCE'{
- extaddgroup=Number,
- components=ExtGroupComps}},
- prop='OPTIONAL'}|Acc]);
-extaddgroup2sequence([C|T],Acc) ->
- extaddgroup2sequence(T,[C|Acc]);
-extaddgroup2sequence([],Acc) ->
+ extaddgroup2sequence(T2,ExtNum+1,
+ [#'ComponentType'{
+ name=list_to_atom("ExtAddGroup"++
+ integer_to_list(ExtNum+1)),
+ typespec=#type{def=#'SEQUENCE'{
+ extaddgroup=Number,
+ components=ExtGroupComps}},
+ prop='OPTIONAL'}|Acc]);
+extaddgroup2sequence([C|T],ExtNum,Acc) ->
+ extaddgroup2sequence(T,ExtNum,[C|Acc]);
+extaddgroup2sequence([],_,Acc) ->
lists:reverse(Acc).