1515-type form () :: atom ().
1616-type position () :: {non_neg_integer (), non_neg_integer ()}.
1717
18- -type otp_version () :: 14 |15 |16 |17 |18 |19 .
18+ -type otp_version () :: 14 |15 |16 |17 |18 |19 | 20 .
1919-spec (make_forms_by_version ([syntaxTree ()], otp_version ()) -> syntaxTree ()).
2020-spec compile (binary () | [atom () | [any ()] | char ()]) -> {'error' ,atom () | {_ ,[any (),...]}}.
2121-spec compile (binary () | [atom () | [any ()] | char ()],[any ()]) -> {'error' ,atom () | {_ ,[any (),...]}}.
2929-spec parse_text ('undefined' | [atom () | [any ()] | char ()],binary (),_ ,_ ) -> {'error' ,{'undefined' | [any ()],[any (),...]}} |
3030 {'error' ,[{_ ,_ }]} |
3131 {'ok' ,[any ()],_ }.
32- -spec parse_tokens ([any ()],'undefined' | [atom () | [any ()] | char ()], otp_version ()) -> {[any ()],[{_ ,_ }]}.
33- -spec parse_tokens ([any ()],[any ()],[any ()],[{_ ,{_ ,_ ,_ }}],_ , otp_version ()) -> {[any ()],[{_ ,_ }]}.
3432
3533% % @spec compile( File::string() ) -> {ok, Module} | {error, Reason}
3634compile (File ) ->
@@ -181,8 +179,8 @@ handle_tokens(FileName, TokenInfo, ProcessedTokens) ->
181179 parse_has_errors (TokenInfo , Forms , Errors ).
182180
183181
184- -spec (parse_has_errors (token (), token (), [{string (), string ()}]) ->
185- error (token (),token ())).
182+ -spec (parse_has_errors (token (), any (), [{string (), string ()}]) ->
183+ error (any (),any ())).
186184parse_has_errors (TokenInfo , Forms , []) ->
187185 {ok , Forms , TokenInfo };
188186parse_has_errors (_TokenInfo , _Forms , Errors ) ->
@@ -202,10 +200,12 @@ transform_tokens(TransformFun,Tokens) when is_function(TransformFun) ->
202200 TransformFun (Tokens ).
203201
204202
203+ -spec parse_tokens ([any ()],'undefined' | [atom () | [any ()] | char ()], otp_version ()) -> {[any ()],[{_ ,_ }]}.
205204parse_tokens (Tokens , FileName , Version ) ->
206205 parse_tokens (Tokens , [], [], [], FileName , Version ).
207206
208- parse_tokens ([], _ , FormAcc , ErrorAcc , _ , Version ) ->
207+ -spec parse_tokens ([any ()],[any ()],[any ()],[{_ ,{_ ,_ ,_ }}],_ , otp_version ()) -> {[any ()],[{_ ,_ }]}.
208+ parse_tokens ([], _ , FormAcc , ErrorAcc , _ , _Version ) ->
209209 {lists :reverse (FormAcc ), lists :reverse (ErrorAcc )};
210210parse_tokens ([{dot , _ }= Token |Rest ], TokenAcc , FormAcc , ErrorAcc , FileName , Version ) ->
211211 case erl_parse :parse_form (lists :reverse ([Token |TokenAcc ])) of
@@ -273,7 +273,7 @@ scan_transform(FileContents, StartLocation) ->
273273-spec (scan_transform_result ({ok , [token ()], pos_integer ()}|
274274 {eof , pos_integer ()} |
275275 {error , string (), pos_integer ()}) ->
276- error ([token ()])).
276+ error ([any ()])).
277277scan_transform_result (Return ) ->
278278 case Return of
279279 {ok , Tokens , _EndLocation } ->
@@ -346,7 +346,7 @@ cut_at_location1({Line, Col}, [C|Rest], {ThisLine, _}, Acc) when C =:= $\n ->
346346cut_at_location1 ({Line , Col }, [C |Rest ], {ThisLine , ThisCol }, Acc ) ->
347347 cut_at_location1 ({Line , Col }, Rest , {ThisLine , ThisCol + 1 }, [C |Acc ]).
348348
349- -spec flatten_token_locations ([token ()]) -> [token ()].
349+ -spec flatten_token_locations ([any ()]) -> [any ()].
350350flatten_token_locations (Tokens ) ->
351351 flatten_token_locations1 (Tokens , []).
352352
0 commit comments