* builtins.trace: in the common case that the value is a string, then
show the string, not the ATerm, so we get `trace: bla' instead of `trace: Str("bla",[])'.
This commit is contained in:
parent
437077c39d
commit
deb342fb08
1 changed files with 6 additions and 1 deletions
|
@ -256,6 +256,11 @@ static Expr prim_getEnv(EvalState & state, const ATermVector & args)
|
||||||
static Expr prim_trace(EvalState & state, const ATermVector & args)
|
static Expr prim_trace(EvalState & state, const ATermVector & args)
|
||||||
{
|
{
|
||||||
Expr e = evalExpr(state, args[0]);
|
Expr e = evalExpr(state, args[0]);
|
||||||
|
string s;
|
||||||
|
PathSet context;
|
||||||
|
if (matchStr(e, s, context))
|
||||||
|
printMsg(lvlError, format("trace: %1%") % s);
|
||||||
|
else
|
||||||
printMsg(lvlError, format("trace: %1%") % e);
|
printMsg(lvlError, format("trace: %1%") % e);
|
||||||
return evalExpr(state, args[1]);
|
return evalExpr(state, args[1]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue