@@ -234,7 +234,7 @@ unwrap_definitions(File, Module) ->
234
234
235
235
{All , Private } = unwrap_definition (ets :tab2list (Table ), File , Module , CTable , [], []),
236
236
Unreachable = elixir_locals :warn_unused_local (File , Module , Private ),
237
- split_definition (All , Unreachable , [], [], [], [], {[], []}).
237
+ split_definition (All , Unreachable , [], [], [], [], [], {[], []}).
238
238
239
239
unwrap_definition ([Fun |T ], File , Module , CTable , All , Private ) ->
240
240
{Tuple , Kind , Line , _ , Check , Location , {Defaults , _ , _ }} = Fun ,
@@ -263,31 +263,35 @@ unwrap_definition([], _File, _Module, _CTable, All, Private) ->
263
263
{All , Private }.
264
264
265
265
split_definition ([{Tuple , def , Line , Location , Body }|T ], Unreachable ,
266
- Def , Defp , Defmacro , Defmacrop , Functions ) ->
266
+ Def , Defp , Defmacro , Defmacrop , Exports , Functions ) ->
267
267
split_definition (T , Unreachable , [Tuple |Def ], Defp , Defmacro , Defmacrop ,
268
+ [export (def , Tuple )|Exports ],
268
269
add_definition (Line , Location , Body , Functions ));
269
270
270
271
split_definition ([{Tuple , defp , Line , Location , Body }|T ], Unreachable ,
271
- Def , Defp , Defmacro , Defmacrop , Functions ) ->
272
+ Def , Defp , Defmacro , Defmacrop , Exports , Functions ) ->
272
273
case lists :member (Tuple , Unreachable ) of
273
274
false ->
274
275
split_definition (T , Unreachable , Def , [Tuple |Defp ], Defmacro , Defmacrop ,
275
- add_definition (Line , Location , Body , Functions ));
276
+ Exports , add_definition (Line , Location , Body , Functions ));
276
277
true ->
277
- split_definition (T , Unreachable , Def , [Tuple |Defp ], Defmacro , Defmacrop , Functions )
278
+ split_definition (T , Unreachable , Def , [Tuple |Defp ], Defmacro , Defmacrop ,
279
+ Exports , Functions )
278
280
end ;
279
281
280
282
split_definition ([{Tuple , defmacro , Line , Location , Body }|T ], Unreachable ,
281
- Def , Defp , Defmacro , Defmacrop , Functions ) ->
283
+ Def , Defp , Defmacro , Defmacrop , Exports , Functions ) ->
282
284
split_definition (T , Unreachable , Def , Defp , [Tuple |Defmacro ], Defmacrop ,
285
+ [export (defmacro , Tuple )|Exports ],
283
286
add_definition (Line , Location , Body , Functions ));
284
287
285
288
split_definition ([{Tuple , defmacrop , _Line , _Location , _Body }|T ], Unreachable ,
286
- Def , Defp , Defmacro , Defmacrop , Functions ) ->
287
- split_definition (T , Unreachable , Def , Defp , Defmacro , [Tuple |Defmacrop ], Functions );
289
+ Def , Defp , Defmacro , Defmacrop , Exports , Functions ) ->
290
+ split_definition (T , Unreachable , Def , Defp , Defmacro , [Tuple |Defmacrop ],
291
+ Exports , Functions );
288
292
289
- split_definition ([], _Unreachable , Def , Defp , Defmacro , Defmacrop , {Head , Tail }) ->
290
- {Def , Defp , Defmacro , Defmacrop , Head ++ Tail }.
293
+ split_definition ([], _Unreachable , Def , Defp , Defmacro , Defmacrop , Exports , {Head , Tail }) ->
294
+ {Def , Defp , Defmacro , Defmacrop , Exports , Head ++ Tail }.
291
295
292
296
% % Helpers
293
297
0 commit comments