22-export ([nesting_alias /2 , last /1 , concat /1 , safe_concat /1 ,
33 format_error /1 , ensure_loaded /3 , ensure_loaded /4 , expand /3 , store /4 ]).
44-include (" elixir.hrl" ).
5- -compile ({parse_transform , elixir_transform }).
65
76% % Store an alias in the given scope
87store (_Meta , New , New , S ) -> S ;
@@ -57,7 +56,7 @@ expand({ '__aliases__', _Meta, List }, _Aliases) ->
5756 List .
5857
5958expand_one (H , Aliases ) ->
60- Lookup = list_to_atom (" Elixir- " ++ atom_to_list (H )),
59+ Lookup = list_to_atom (" Elixir. " ++ atom_to_list (H )),
6160 case lookup (Lookup , Aliases ) of
6261 Lookup -> false ;
6362 Else -> Else
@@ -87,9 +86,9 @@ ensure_loaded(Line, File, Ref, FileModules) ->
8786
8887last (Atom ) ->
8988 Last = last (lists :reverse (atom_to_list (Atom )), []),
90- list_to_atom (" Elixir- " ++ Last ).
89+ list_to_atom (" Elixir. " ++ Last ).
9190
92- last ([$- |_ ], Acc ) -> Acc ;
91+ last ([$. |_ ], Acc ) -> Acc ;
9392last ([H |T ], Acc ) -> last (T , [H |Acc ]);
9493last ([], Acc ) -> Acc .
9594
@@ -118,12 +117,12 @@ nesting_alias(Prefix, Full) ->
118117do_nesting ([X |PreTail ], [X |Tail ], Acc ) ->
119118 do_nesting (PreTail , Tail , [X |Acc ]);
120119do_nesting ([], [H |_ ], Acc ) ->
121- { list_to_atom (" Elixir- " ++ H ), concat (lists :reverse ([H |Acc ])) };
120+ { list_to_atom (" Elixir. " ++ H ), concat (lists :reverse ([H |Acc ])) };
122121do_nesting (_ , _ , _Acc ) ->
123122 false .
124123
125124list_nesting (Atom ) ->
126- case string :tokens (atom_to_list (Atom ), " - " ) of
125+ case string :tokens (atom_to_list (Atom ), " . " ) of
127126 [" Elixir" |T ] -> T ;
128127 _ -> []
129128 end .
@@ -143,15 +142,9 @@ do_concat(Args) ->
143142
144143to_partial (Arg ) when is_binary (Arg ) -> to_partial (binary_to_list (Arg ));
145144to_partial (Arg ) when is_atom (Arg ) -> to_partial (atom_to_list (Arg ));
146- to_partial (" Elixir-" ++ Arg ) -> dot_to_dash ([$- |Arg ]);
147- to_partial ([$- |_ ] = Arg ) -> dot_to_dash (Arg );
148- to_partial (Arg ) when is_list (Arg ) -> [$- |dot_to_dash (Arg )].
149-
150- dot_to_dash (List ) ->
151- [case X of
152- $. -> $- ;
153- _ -> X
154- end || X <- List ].
145+ to_partial (" Elixir." ++ Arg ) -> [$. |Arg ];
146+ to_partial ([$. |_ ] = Arg ) -> Arg ;
147+ to_partial (Arg ) when is_list (Arg ) -> [$. |Arg ].
155148
156149% % Lookup an alias in the current scope.
157150
0 commit comments