From 555b40a98c4181416c54d5c121c229f593a72cfc Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 1 Feb 2014 18:52:09 +0100 Subject: Don't munge record and field names in cover They are bare atoms, atoms or variables in the abstract format, there is no need to pass them through munge_expr/2. --- lib/tools/src/cover.erl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/tools') diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 13d9aefb0c..cd5e3b9955 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -1800,16 +1800,14 @@ munge_expr({match,Line,ExprL,ExprR}, Vars) -> munge_expr({tuple,Line,Exprs}, Vars) -> {MungedExprs, Vars2} = munge_exprs(Exprs, Vars, []), {{tuple,Line,MungedExprs}, Vars2}; -munge_expr({record,Line,Expr,Exprs}, Vars) -> +munge_expr({record,Line,Name,Exprs}, Vars) -> %% Only for Vsn=raw_abstract_v1 - {MungedExprName, Vars2} = munge_expr(Expr, Vars), - {MungedExprFields, Vars3} = munge_exprs(Exprs, Vars2, []), - {{record,Line,MungedExprName,MungedExprFields}, Vars3}; + {MungedExprFields, Vars2} = munge_exprs(Exprs, Vars, []), + {{record,Line,Name,MungedExprFields}, Vars2}; munge_expr({record_field,Line,ExprL,ExprR}, Vars) -> %% Only for Vsn=raw_abstract_v1 - {MungedExprL, Vars2} = munge_expr(ExprL, Vars), - {MungedExprR, Vars3} = munge_expr(ExprR, Vars2), - {{record_field,Line,MungedExprL,MungedExprR}, Vars3}; + {MungedExprR, Vars2} = munge_expr(ExprR, Vars), + {{record_field,Line,ExprL,MungedExprR}, Vars2}; munge_expr({cons,Line,ExprH,ExprT}, Vars) -> {MungedExprH, Vars2} = munge_expr(ExprH, Vars), {MungedExprT, Vars3} = munge_expr(ExprT, Vars2), -- cgit v1.2.3 From 2cf4803f3e49eeadda29b50b6b26370312e8a482 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 1 Feb 2014 18:53:54 +0100 Subject: Properly munge record updates in cover Trees {record,Line,Arg,Name,Fields} were not munged. --- lib/tools/src/cover.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/tools') diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index cd5e3b9955..62e78703a9 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -1804,6 +1804,11 @@ munge_expr({record,Line,Name,Exprs}, Vars) -> %% Only for Vsn=raw_abstract_v1 {MungedExprFields, Vars2} = munge_exprs(Exprs, Vars, []), {{record,Line,Name,MungedExprFields}, Vars2}; +munge_expr({record,Line,Arg,Name,Exprs}, Vars) -> + %% Only for Vsn=raw_abstract_v1 + {MungedArg, Vars2} = munge_expr(Arg, Vars), + {MungedExprFields, Vars3} = munge_exprs(Exprs, Vars2, []), + {{record,Line,MungedArg,Name,MungedExprFields}, Vars3}; munge_expr({record_field,Line,ExprL,ExprR}, Vars) -> %% Only for Vsn=raw_abstract_v1 {MungedExprR, Vars2} = munge_expr(ExprR, Vars), -- cgit v1.2.3