Fixed macro def expansion
This commit is contained in:
@@ -46,8 +46,6 @@ type
|
||||
|
||||
// --- Standard Traversal (Use inherited) ---
|
||||
function VisitKeyword(const Node: IKeywordNode): IAstNode; override;
|
||||
function VisitMacroDefinition(const Node: IMacroDefinitionNode): IAstNode; override;
|
||||
function VisitMacroExpansionNode(const Node: IMacroExpansionNode): IAstNode; override;
|
||||
function VisitRecurNode(const Node: IRecurNode): IAstNode; override;
|
||||
function VisitConstant(const Node: IConstantNode): IAstNode; override;
|
||||
function VisitCreateSeries(const Node: ICreateSeriesNode): IAstNode; override;
|
||||
@@ -171,21 +169,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAstBinder.VisitMacroDefinition(const Node: IMacroDefinitionNode): IAstNode;
|
||||
begin
|
||||
// Macros are compile-time only. The Binder (Phase 2) should not see them.
|
||||
raise Exception.Create('TMyAstBinder: MacroDefinition node encountered.');
|
||||
end;
|
||||
|
||||
function TAstBinder.VisitMacroExpansionNode(const Node: IMacroExpansionNode): IAstNode;
|
||||
begin
|
||||
// The MacroExpander (Phase 1) created this node.
|
||||
// We must bind the ExpandedBody, but keep the MacroExpansionNode wrapper.
|
||||
// The base TAstTransformer implementation already does exactly this
|
||||
// by visiting Callee, Arguments, and ExpandedBody.
|
||||
Result := inherited VisitMacroExpansionNode(Node);
|
||||
end;
|
||||
|
||||
function TAstBinder.VisitFunctionCall(const Node: IFunctionCallNode): IAstNode;
|
||||
begin
|
||||
// --- Transformation: Keyword-as-Function ---
|
||||
|
||||
Reference in New Issue
Block a user