aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <egil@erlang.org>2014-01-30 13:24:18 +0100
committerBjörn-Egil Dahlberg <egil@erlang.org>2014-01-30 13:24:18 +0100
commit32e01a883c4c29199174903112387f841fcab681 (patch)
tree7c720b91b91dcd8065f77ce02318effcd9321dd4 /lib/syntax_tools
parent30634c48a18f1b79d27083418ac44b90fd68c437 (diff)
parent1552476d5ba74e177ea9d6b2d2714fd7354a465d (diff)
downloadotp-32e01a883c4c29199174903112387f841fcab681.tar.gz
otp-32e01a883c4c29199174903112387f841fcab681.tar.bz2
otp-32e01a883c4c29199174903112387f841fcab681.zip
Merge branch 'nox/syntax-tools-named-fun-fixes/OTP-11651'
* nox/syntax-tools-named-fun-fixes/OTP-11651: Fix representation of named funs in syntax_tools
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 78a37445ed..93187fa018 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -5691,15 +5691,15 @@ fun_expr_arity(Node) ->
-spec named_fun_expr(syntaxTree(), [syntaxTree()]) -> syntaxTree().
named_fun_expr(Name, Clauses) ->
- tree(fun_expr, #named_fun_expr{name = Name, clauses = Clauses}).
+ tree(named_fun_expr, #named_fun_expr{name = Name, clauses = Clauses}).
revert_named_fun_expr(Node) ->
Pos = get_pos(Node),
Name = named_fun_expr_name(Node),
Clauses = [revert_clause(C) || C <- named_fun_expr_clauses(Node)],
case type(Name) of
- var ->
- {named_fun, Pos, concrete(Name), Clauses};
+ variable ->
+ {named_fun, Pos, variable_name(Name), Clauses};
_ ->
Node
end.
@@ -5715,7 +5715,7 @@ revert_named_fun_expr(Node) ->
named_fun_expr_name(Node) ->
case unwrap(Node) of
{named_fun, Pos, Name, _} ->
- set_pos(atom(Name), Pos);
+ set_pos(variable(Name), Pos);
Node1 ->
(data(Node1))#named_fun_expr.name
end.