Skip to content

Commit

Permalink
fix augmented ops
Browse files Browse the repository at this point in the history
  • Loading branch information
pzinn committed Nov 28, 2024
1 parent 45f7ca9 commit 4791da6
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions M2/Macaulay2/d/evaluate.d
Original file line number Diff line number Diff line change
Expand Up @@ -1274,34 +1274,19 @@ augmentedAssignmentFun(x:augmentedAssignmentCode):Expr := (
else return r)
else return r);
-- if not, use default behavior
r:=nullE;
f:=s.binary; if f==dummyBinaryFun then
r=binarymethod(Code(left),x.rhs,SymbolClosure(globalFrame,s))
else
r=f(Code(left),x.rhs);
when r is e:Error do Expr(e) else (
when x.lhs
is y:globalMemoryReferenceCode do (
r := s.binary(Code(left), x.rhs);
when r is e:Error do Expr(e)
else globalAssignment(y.frameindex, x.info, r))
is y:localMemoryReferenceCode do (
r := s.binary(Code(left), x.rhs);
when r is e:Error do Expr(e)
else localAssignment(y.nestingDepth, y.frameindex, r))
is y:threadMemoryReferenceCode do (
r := s.binary(Code(left), x.rhs);
when r is e:Error do Expr(e)
else globalAssignment(y.frameindex, x.info, r))
is y:binaryCode do (
r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition));
if y.f == DotS.symbol.binary || y.f == SharpS.symbol.binary
then AssignElemFun(y.lhs, y.rhs, r)
else InstallValueFun(CodeSequence(
convertGlobalOperator(x.info), y.lhs, y.rhs, r)))
is y:adjacentCode do (
r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition));
InstallValueFun(CodeSequence(
convertGlobalOperator(AdjacentS.symbol), y.lhs, y.rhs, r)))
is y:unaryCode do (
r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition));
UnaryInstallValueFun(convertGlobalOperator(x.info), y.rhs, r))
is y:globalMemoryReferenceCode do globalAssignment(y.frameindex, x.info, r)
is y:localMemoryReferenceCode do localAssignment(y.nestingDepth, y.frameindex, r)
is y:threadMemoryReferenceCode do globalAssignment(y.frameindex, x.info, r)
else buildErrorPacket(
"augmented assignment not implemented for this code")));
"augmented assignment not implemented for this code")
)));

-----------------------------------------------------------------------------
steppingFurther(c:Code):bool := steppingFlag && (
Expand Down

0 comments on commit 4791da6

Please sign in to comment.