Skip to content

Commit 9e37412

Browse files
author
José Valim
committed
Provide an endpoint for translating elixir forms
1 parent e64d744 commit 9e37412

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/elixir/src/elixir.erl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,19 @@ eval_quoted(Tree, Binding, Line, #elixir_scope{} = S) when is_integer(Line) ->
113113
%% Handle forms evaluation internally, it is an
114114
%% internal API not meant for external usage.
115115

116-
eval_forms(Tree, Binding, RawScope) ->
117-
Scope = RawScope#elixir_scope{
116+
translate_forms(Tree, Binding, Opts) when is_list(Opts) ->
117+
translate_forms(Tree, Binding, scope_for_eval(Opts));
118+
119+
translate_forms(Tree, Binding, #elixir_scope{} = Scope) ->
120+
elixir_translator:translate(Tree, Scope#elixir_scope{
118121
vars=binding_dict(Binding),
119122
temp_vars=[],
120123
clause_vars=nil,
121124
counter=[]
122-
},
123-
{ ParseTree, NewScope } = elixir_translator:translate(Tree, Scope),
125+
}).
126+
127+
eval_forms(Tree, Binding, Scope) ->
128+
{ ParseTree, NewScope } = translate_forms(Tree, Binding, Scope),
124129
case ParseTree of
125130
[] -> { nil, Binding, NewScope };
126131
_ ->

0 commit comments

Comments
 (0)