Making AST node inmmutable - WIP

This commit is contained in:
Michael Schimmel
2025-11-04 20:12:12 +01:00
parent 48ccb23060
commit d82a75aba6
6 changed files with 123 additions and 56 deletions
+14 -2
View File
@@ -37,7 +37,8 @@ type
IAddSeriesItemNode = interface;
ISeriesLengthNode = interface;
IRecurNode = interface;
INopNode = interface; // Added Nop
INopNode = interface;
IBoundIdentifierNode = interface;
// Defines the concrete kinds of AST nodes
TAstNodeKind = (
@@ -65,7 +66,9 @@ type
akAddSeriesItem,
akSeriesLength,
akRecur,
akNop // Added Nop
akNop,
// Internal node produced by compiler
akBoundIdentifier
);
// Helper for TAstNodeKind providing a string representation
@@ -156,6 +159,8 @@ type
function AsRecur: IRecurNode;
function AsNop: INopNode; // Added Nop
function AsBoundIdentifierNode: IBoundIdentifierNode;
property Kind: TAstNodeKind read GetKind;
end;
@@ -179,6 +184,13 @@ type
property Name: string read GetName;
end;
IBoundIdentifierNode = interface(IIdentifierNode)
{$region 'private'}
function GetAddress: TResolvedAddress;
{$endregion}
property Address: TResolvedAddress read GetAddress;
end;
// Represents a keyword literal in the AST (e.g., :foo)
IKeywordNode = interface(IAstNode)
{$region 'private'}