From 1552476d5ba74e177ea9d6b2d2714fd7354a465d Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 28 Jan 2014 15:29:27 +0100 Subject: Fix representation of named funs in syntax_tools A named fun's name is a variable name, its type in syntax_tools is named_fun_expr. --- lib/syntax_tools/src/erl_syntax.erl | 8 ++++---- 1 file 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. -- cgit v1.2.3