|
|
@@ -1463,7 +1463,7 @@ PRODUCTIONS
|
|
|
q2, mg0: QbeGen.QVal;
|
|
|
isR, conv, wconv: BOOLEAN;
|
|
|
called, sfx: BOOLEAN;
|
|
|
- astLhs: AST.Node; .)
|
|
|
+ astLhs, astRes: AST.Node; .)
|
|
|
= Design<dt, dk, qd, qn, sfx>
|
|
|
(. astLhs := astCur; astNArgs := 0; .)
|
|
|
( ":="
|
|
|
@@ -1499,8 +1499,22 @@ PRODUCTIONS
|
|
|
AND (SymTab.ClassOf(dt) #
|
|
|
SymTab.ClClass) THEN
|
|
|
END; .)
|
|
|
- | ArgList<qn, dt, qd, FALSE, FALSE, methCls, ct2, q2, called>
|
|
|
- (. astStmt := AstCallNode(astLhs); .)
|
|
|
+ | ArgList<qn, dt, qd, TRUE, TRUE, methCls, ct2, q2, called>
|
|
|
+ (. astRes := AstCallNode(astLhs);
|
|
|
+ sfx := FALSE; .)
|
|
|
+ ( { ResultComp<ct2, q2, sfx, astRes> }
|
|
|
+ ":=" Expr<et, qe> (. astStmt := AST.MakeBin(
|
|
|
+ AST.NkAssign, 0, astRes, astCur);
|
|
|
+ IF NOT sfx THEN
|
|
|
+ SemError(233)
|
|
|
+ ELSIF (ct2 # SymTab.InvalidType)
|
|
|
+ AND NOT SymTab.Assignable(et, ct2) THEN
|
|
|
+ SemError(210)
|
|
|
+ END; .)
|
|
|
+ | (. IF ct2 #
|
|
|
+ SymTab.InvalidType THEN
|
|
|
+ SemError(233) END;
|
|
|
+ astStmt := astRes; .) )
|
|
|
| (* bare `P;`: proper parameterless
|
|
|
procedure call; anything else
|
|
|
here is 233 (was a bare syntax
|
|
|
@@ -1572,7 +1586,7 @@ PRODUCTIONS
|
|
|
ELSIF want THEN
|
|
|
IF res =
|
|
|
SymTab.InvalidType THEN
|
|
|
- SemError(233);
|
|
|
+ IF NOT soft THEN SemError(233) END;
|
|
|
t := SymTab.InvalidType;
|
|
|
QbeGen.CopyOp("0", q)
|
|
|
ELSE t := res;
|