Skip to content

Commit

Permalink
change locate FunctionBody
Browse files Browse the repository at this point in the history
  • Loading branch information
pzinn committed Sep 17, 2024
1 parent 440a9af commit 38fbf77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion M2/Macaulay2/d/convertr.d
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export convert0(e:ParseTree):Code := (
p:=treePosition(a.lhs);
fc:=functionCode(
unseq(c:=convert0(a.rhs)),a.desc,hash_t(0),
combinePositionC(p,codePosition(c), a.Operator.position));
combinePositionR(p,codePosition(c)));
fc.hash = hashFromAddress(Expr(fc));
Code(fc))
is u:Unary do (
Expand Down
5 changes: 4 additions & 1 deletion M2/Macaulay2/d/debugging.dd
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ locate(e:Expr):Expr := (
is Nothing do nullE
is Sequence do locate(lookupfun(e))
is f:FunctionClosure do locate(f.model.position)
is f:functionCode do locate(codePosition(f.body))
is f:functionCode do (
p:=f.position;
locate(Position(p.filename,p.lineF,p.columnF,p.lineR,p.columnR,p.lineF,p.columnF,p.loadDepth))
)
-- TODO: can we use binary debug symbols?
is CompiledFunction do nullE
is CompiledFunctionBody do nullE
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/d/evaluate.d
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export applyFCS(c:FunctionClosure,v:Sequence):Expr := (
);

wrongModel1(model:functionCode):Expr := printErrorMessageE(
Code(model),
Position(model.position.filename,model.position.lineL,model.position.columnL,model.position.lineL,model.position.columnL,model.position.lineL,model.position.columnL,model.position.loadDepth),
"expected " + tostring(model.desc.numparms) + " argument" + (if model.desc.numparms == 1 then "" else "s") + " but got 1"
);

Expand Down

0 comments on commit 38fbf77

Please sign in to comment.