aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_per.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-03-14 10:48:57 +0100
committerBjörn Gustavsson <[email protected]>2017-03-14 15:41:21 +0100
commitafd0690257ce11ca1e4b50fe70e8f731357dacd1 (patch)
tree0d312eeff394427d8342b2e23ed0e492e9bb3bea /lib/asn1/src/asn1ct_gen_per.erl
parent608e04fb0bf6f88efce4aa2a5ff3cfc50f07fba0 (diff)
downloadotp-afd0690257ce11ca1e4b50fe70e8f731357dacd1.tar.gz
otp-afd0690257ce11ca1e4b50fe70e8f731357dacd1.tar.bz2
otp-afd0690257ce11ca1e4b50fe70e8f731357dacd1.zip
Clean up comments
* Remove out-commented code * Fix obvious typos and bad grammar * Adhere to the conventions for when to use "%" and "%%".
Diffstat (limited to 'lib/asn1/src/asn1ct_gen_per.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 79e58395cf..645e0e3aeb 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -24,7 +24,6 @@
%% all types in an ASN.1 module
-include("asn1_records.hrl").
-%-compile(export_all).
-export([gen_dec_imm/2]).
-export([gen_dec_prim/3,gen_encode_prim_imm/3]).
@@ -39,8 +38,9 @@
-import(asn1ct_func, [call/3]).
-%% Generate ENCODING ******************************
-%%****************************************x
+%%****************************************
+%% Generate ENCODING
+%%****************************************
dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) ->
Mod = case Aligned of
@@ -58,14 +58,6 @@ dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) ->
gen_encode(Erules,Type) when is_record(Type,typedef) ->
gen_encode_user(Erules,Type).
-%% case Type#typedef.typespec of
-%% Def when is_record(Def,type) ->
-%% gen_encode_user(Erules,Type);
-%% Def when is_tuple(Def),(element(1,Def) == 'Object') ->
-%% gen_encode_object(Erules,Type);
-%% Other ->
-%% exit({error,{asn1,{unknown,Other}}})
-%% end.
gen_encode(Erules,Typename,#'ComponentType'{name=Cname,typespec=Type}) ->
NewTypename = [Cname|Typename],
@@ -76,7 +68,6 @@ gen_encode(Erules,Typename,Type) when is_record(Type,type) ->
ObjFun =
case lists:keysearch(objfun,1,Type#type.tablecinf) of
{value,{_,_Name}} ->
-%% lists:concat([", ObjFun",Name]);
", ObjFun";
false ->
""
@@ -396,10 +387,11 @@ gen_dec_prim(Erule, Type, BytesVar) ->
asn1ct_imm:dec_code_gen(Imm, BytesVar).
-%% For PER the ExtensionAdditionGroup notation has significance for the encoding and decoding
-%% the components within the ExtensionAdditionGroup is treated in a similar way as if they
-%% have been specified within a SEQUENCE, therefore we construct a fake sequence type here
-%% so that we can generate code for it
+%% For PER the ExtensionAdditionGroup notation has significance for
+%% the encoding and decoding. The components within the
+%% ExtensionAdditionGroup is treated in a similar way as if they 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,0,[]).