diff options
author | Kenneth Lundin <[email protected]> | 2010-09-10 12:09:00 +0200 |
---|---|---|
committer | Kenneth Lundin <[email protected]> | 2010-09-10 12:09:00 +0200 |
commit | 357860d3b5def55eba80523c0be83ee4ebcab12c (patch) | |
tree | ce7ecf49f15053bd9aafd460e6201a7d6d44e33a /lib/asn1/src/asn1ct_gen.erl | |
parent | 1470138027905c4adfd87d805457a40b39c2bdc6 (diff) | |
parent | 210fbb984619e6a6bb1122b7a6f72f54fb72effb (diff) | |
download | otp-357860d3b5def55eba80523c0be83ee4ebcab12c.tar.gz otp-357860d3b5def55eba80523c0be83ee4ebcab12c.tar.bz2 otp-357860d3b5def55eba80523c0be83ee4ebcab12c.zip |
Merge branch 'kenneth/asn1/nested_extaddgroup/OTP-8797' into dev
* kenneth/asn1/nested_extaddgroup/OTP-8797:
Add support for ExtensionAdditionGroup notation in nested types as well
Conflicts:
lib/asn1/test/test_undecoded_rest.erl
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r-- | lib/asn1/src/asn1ct_gen.erl | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl index 6b511a66da..0bb0b65e5d 100644 --- a/lib/asn1/src/asn1ct_gen.erl +++ b/lib/asn1/src/asn1ct_gen.erl @@ -537,33 +537,18 @@ gen_part_decode_funcs(WhatKind,_TypeName,{_,Directive,_,_}) -> throw({error,{asn1,{"Not implemented yet",WhatKind," partial incomplete directive:",Directive}}}). -extaddgroup2sequence(ExtList) -> - extaddgroup2sequence(ExtList,[]). - -extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],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) -> - lists:reverse(Acc). - - gen_types(Erules,Tname,{RootL1,ExtList,RootL2}) when is_list(RootL1), is_list(RootL2) -> gen_types(Erules,Tname,RootL1), - gen_types(Erules,Tname,extaddgroup2sequence(ExtList)), + Rtmod = list_to_atom(lists:concat(["asn1ct_gen_",erule(Erules), + rt2ct_suffix(Erules)])), + gen_types(Erules,Tname,Rtmod:extaddgroup2sequence(ExtList)), gen_types(Erules,Tname,RootL2); gen_types(Erules,Tname,{RootList,ExtList}) when is_list(RootList) -> gen_types(Erules,Tname,RootList), - gen_types(Erules,Tname,extaddgroup2sequence(ExtList)); + Rtmod = list_to_atom(lists:concat(["asn1ct_gen_",erule(Erules), + rt2ct_suffix(Erules)])), + gen_types(Erules,Tname,Rtmod:extaddgroup2sequence(ExtList)); gen_types(Erules,Tname,[{'EXTENSIONMARK',_,_}|Rest]) -> gen_types(Erules,Tname,Rest); gen_types(Erules,Tname,[ComponentType|Rest]) -> |