Skip to content

Commit

Permalink
Changed entry function of 'paterl_anno' module from annotate/1 to mod…
Browse files Browse the repository at this point in the history
…ule/1.
  • Loading branch information
duncanatt committed Aug 30, 2024
1 parent e390764 commit 9292aff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/paterl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ compile(File, Opts) when is_list(File), is_list(Opts) ->

% Annotate forms using type table.
io:fwrite(color:green("[ANNOTATE] Annotating Erlang forms.~n")),
%% case paterl_anno:annotate(Forms, TInfo) of
%% case paterl_anno:annotate(Desugared0, TInfo0) of
%% paterl_anno:annotate(Desugared0, TInfo0) == paterl_anno_3:annotate(Desugared0, TInfo0),
case paterl_anno:annotate(Desugared0, TInfo0) of
case paterl_anno_2:module(Desugared0, TInfo0) of

{ok, Annotated} ->
% Forms annotated.
Expand Down
6 changes: 3 additions & 3 deletions src/paterl_anno.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-include("paterl.hrl").

%% API
-export([annotate/2]).
-export([module/2]).

-compile(export_all).

Expand Down Expand Up @@ -85,9 +85,9 @@
%% @param TInfo: Type annotations.
%%
%% @returns Annotated AST.
-spec annotate([erl_syntax:syntaxTree()], paterl_types:t_info()) ->
-spec module([erl_syntax:syntaxTree()], paterl_types:t_info()) ->
{ok, erl_syntax:forms()} | errors:error().
annotate(Forms, TInfo) when is_list(Forms), is_record(TInfo, t_info) ->
module(Forms, TInfo) when is_list(Forms), is_record(TInfo, t_info) ->
case annotate_forms(Forms, TInfo, #error{}) of
{Forms0, #error{errors = []}} ->
{ok, Forms0};
Expand Down

0 comments on commit 9292aff

Please sign in to comment.