Beginning Editor

This commit is contained in:
Michael Schimmel
2025-09-08 18:59:04 +02:00
parent 7e4ecb2ff9
commit a9cc9633a2
14 changed files with 1582 additions and 288 deletions
+6 -6
View File
@@ -90,11 +90,11 @@ type
TClosureValue = class(TInterfacedObject, TAstValue.IClosure)
private
FBody: IExpressionNode;
FBody: IAstNode;
FClosureScope: IExecutionScope;
FLambdaNode: ILambdaExpressionNode;
FUpvalues: TArray<IValueCell>;
function GetBody: IExpressionNode;
function GetBody: IAstNode;
function GetParameters: TArray<IIdentifierNode>;
function GetClosureScope: IExecutionScope;
function GetUpvalues: TArray<IValueCell>;
@@ -113,7 +113,7 @@ type
TNativeClosure = class(TInterfacedObject, TAstValue.IClosure)
private
FMethod: TNativeFunction;
function GetBody: IExpressionNode;
function GetBody: IAstNode;
function GetParameters: TArray<IIdentifierNode>;
function GetClosureScope: IExecutionScope;
function GetUpvalues: TArray<IValueCell>;
@@ -167,7 +167,7 @@ begin
FUpvalues := AUpvalues; // Store the captured cells
end;
function TClosureValue.GetBody: IExpressionNode;
function TClosureValue.GetBody: IAstNode;
begin
Result := FBody;
end;
@@ -195,7 +195,7 @@ begin
FMethod := AMethod;
end;
function TNativeClosure.GetBody: IExpressionNode;
function TNativeClosure.GetBody: IAstNode;
begin
Result := nil;
end;
@@ -639,7 +639,7 @@ end;
function TEvaluatorVisitor.VisitBlockExpression(const Node: IBlockExpressionNode): TAstValue;
var
expression: IExpressionNode;
expression: IAstNode;
begin
// The result of a block is the result of its last expression.
Result := TAstValue.Void;