2020
2121
2222-export ([compile /1 , compile /2 , edoc_module /1 , edoc_module /2 , process_tokens /1 , trick_out_forms /2 ]).
23- -spec compile (binary () | [atom () | [any ()] | char ()]) -> any ().
24- -spec compile (binary () | [atom () | [any ()] | char ()],[any ()]) -> any ().
23+ -spec compile (binary () | [atom () | [any ()] | char ()]) -> { 'error' , atom () | { _ ,[ any (),...]}} .
24+ -spec compile (binary () | [atom () | [any ()] | char ()],[any ()]) -> { 'error' , atom () | { _ ,[ any (),...]}} .
2525-spec edoc_module (string ()) -> {atom () | tuple (),_ }.
2626-spec edoc_module (string (),_ ) -> {module (),_ }.
2727-spec process_tokens (nonempty_maybe_improper_list ()) -> {nonempty_maybe_improper_list (),[{_ ,_ }]}.
3838 [pair (),...],
3939 [pair (),...],
4040 [ atom ()]) -> error ([syntaxTree ()]).
41- -spec has_duplicates ([any ()]) -> any ().
42- -spec trick_out_forms ([any (),...],[any ()]) -> [any (),...].
43- -spec trick_out_forms ([any (),...],[any ()],[any ()]) -> [any (),...].
41+ -spec has_duplicates ([any ()]) -> boolean ().
42+ -spec trick_out_forms ([any (),...],[{ atom (), atom ()},...]) -> [any (),...].
43+ -spec trick_out_forms ([any (),...],[any ()],[{ atom (), atom ()},...]) -> [any (),...].
4444-spec trick_out_forms ([any (),...],[any ()],atom (),[any ()],[any ()]) -> [any (),...].
4545-spec list_functions ([atom ()]) -> [fctn_n ()].
4646-spec list_functions ([atom ()],[fctn_n ()]) -> [fctn_n ()].
4747-spec override_functions ([syntaxTree ()|fctn (),...],[fctn_n ()]) -> [syntaxTree ()].
4848-spec override_functions ([syntaxTree ()|fctn ()],[syntaxTree ()],[fctn_n ()]) -> [any ()].
4949-spec export_forms ([{atom (), pos_integer ()}]) -> syntaxTree ().
5050-spec export_forms ([{atom (), pos_integer ()}],[syntaxTree ()]) -> syntaxTree ().
51- -spec database_columns_forms (atom () ,[atom ()],[pair ()]) -> syntaxTree ().
52- -spec database_table_forms (atom (),[pair ()]) -> syntaxTree ().
51+ -spec database_columns_forms (atom () ,[atom ()],[pair ()]) -> syntaxTree ().
52+ -spec database_table_forms (atom (),[pair ()]) -> syntaxTree ().
5353-spec attribute_types_forms (atom () ,[{atom (), atom ()}]) -> syntaxTree ().
5454-spec validate_types_forms (atom ()) -> syntaxTree ().
5555-spec validate_forms (atom ()) -> syntaxTree ().
6262-spec set_attributes_forms (atom (),[atom ()]) -> syntaxTree ().
6363-spec association_forms (atom (),[assoc ()]) -> [any (),...].
6464
65- -spec belongs_to_list_forms ([{atom (),any ()}]) -> syntaxTree () .
65+ -spec belongs_to_list_forms ([{atom (),atom ()}]) -> [{ 'tree' , atom (),{ _ , _ , _ , _ }, _ } | { 'wrapper' , atom (),{ _ , _ , _ , _ }, _ },...] .
6666
67- -spec belongs_to_list_make_list ([pair ()]) -> syntaxTree ().
67+ -spec belongs_to_list_make_list ([pair ()]) -> syntaxTree ().
6868-spec attribute_names_forms (name (),[atom ()]) -> syntaxTree ().
6969-spec has_one_forms (name (),atom (),[any ()]) -> syntaxTree ().
70- -spec has_many_forms (atom (),atom (), limit (), [any ()]) -> syntaxTree ().
70+ -spec has_many_forms (atom (),atom (), limit (), [any ()]) -> syntaxTree ().
7171-spec first_or_undefined_forms ( syntaxTree ()) -> syntaxTree ().
7272-spec has_many_application_forms (name (),{'tree' ,atom (),{'attr' ,_ ,[any ()],'none' | {_ ,_ ,_ }},_ } | {'wrapper' ,atom (),{'attr' ,_ ,[any ()],'none' | {_ ,_ ,_ }},_ },
7373 pos_integer () | all ,
8585-spec counter_reset_forms ([name ()]) -> syntaxTree ().
8686-spec counter_incr_forms ([name ()]) -> syntaxTree ().
8787-spec counter_name_forms (name ()) -> syntaxTree ().
88- -spec parameter_to_colname (atom ()) -> string () .
88+ -spec parameter_to_colname (atom ()) -> [ byte ()] .
8989
9090
9191% % @Spec compile( File::string() ) -> {ok, Module} | {error, Reason}
@@ -117,7 +117,7 @@ edoc_module(File, Options) ->
117117 Options ).
118118
119119process_tokens (Tokens ) ->
120- lager :info (" Tokens ~p " ,[Tokens ]),
120+ _ = lager :info (" Tokens ~p " ,[Tokens ]),
121121 process_tokens (Tokens , [], []).
122122
123123process_tokens ([{']' ,_ },
@@ -149,7 +149,7 @@ process_tokens([{'-',_N } = T1,
149149 {')' ,_ }|Rest ] = _T ,
150150 TokenAcc , []) ->
151151 % lager:notice("Tokens ~p", [_T]) ,
152- lager :info (" Var Type ~p " ,[VarType ]),
152+ _ = lager :info (" Var Type ~p " ,[VarType ]),
153153 process_tokens (Rest , lists :reverse ([T1 , T2 , T3 , T4 , T5 , T6 , T7 ], TokenAcc ), [{'Id' , VarType }]);
154154
155155process_tokens ([{',' ,_ } = T1 ,
@@ -160,7 +160,7 @@ process_tokens([{',',_} = T1,
160160 {')' ,_ } |Rest ] = _T ,
161161 TokenAcc , Acc ) ->
162162% lager:notice("Tokens ~p", [_T]),
163- lager :info (" Var Type ~p " ,[VarType ]),
163+ _ = lager :info (" Var Type ~p " ,[VarType ]),
164164 process_tokens (Rest , lists :reverse ([T1 , T2 ], TokenAcc ), [{VarName , VarType }|Acc ]);
165165
166166process_tokens ([H |T ], TokenAcc , Acc ) ->
@@ -216,13 +216,13 @@ make_generated_forms(ModuleName, Parameters, _TokenInfo, _Attributes,
216216make_generated_forms (ModuleName , Parameters , _TokenInfo , _Attributes ,
217217 _Counters , _Dup = true ) ->
218218 DupFields = Parameters -- sets :to_list (sets :from_list (Parameters )),
219- lager :error (" Unable to compile module ~p due to duplicate field(s) ~p " ,
219+ _ = lager :error (" Unable to compile module ~p due to duplicate field(s) ~p " ,
220220 [ModuleName , DupFields ]),
221221 {error , " Duplicate Fields" };
222222
223223make_generated_forms (ModuleName , Parameters , TokenInfo , Attributes ,
224224 Counters , _Dup = false ) ->
225- lager :notice (" Module \" ~p \" Parameters ~p Attributes~p " , [ModuleName ,Parameters , Attributes ]),
225+ _ = lager :notice (" Module \" ~p \" Parameters ~p Attributes~p " , [ModuleName ,Parameters , Attributes ]),
226226 GF = attribute_names_forms (ModuleName , Parameters ) ++
227227 attribute_types_forms (ModuleName , TokenInfo ) ++
228228 database_columns_forms (ModuleName , Parameters , Attributes ) ++
0 commit comments