Refactoring for immutable nodes
This commit is contained in:
@@ -85,16 +85,16 @@ end;
|
||||
|
||||
function TAstLowerer.VisitFunctionCall(const Node: IFunctionCallNode): IAstNode;
|
||||
var
|
||||
calleeIdentifier: TIdentifierNode;
|
||||
calleeIdentifier: IIdentifierNode;
|
||||
binaryOp: TScalar.TBinaryOp;
|
||||
unaryOp: TScalar.TUnaryOp;
|
||||
left, right: IAstNode;
|
||||
nodeType: IStaticType;
|
||||
begin
|
||||
// --- Optimization: Operator Folding ---
|
||||
if (Node.Callee is TIdentifierNode) then
|
||||
if Node.Callee.Kind = akIdentifier then
|
||||
begin
|
||||
calleeIdentifier := Node.Callee as TIdentifierNode;
|
||||
calleeIdentifier := Node.Callee.AsIdentifier;
|
||||
// Get the type *before* replacing the node (it's an IAstTypedNode)
|
||||
nodeType := Node.AsTypedNode.StaticType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user