Ast environment refactoring
This commit is contained in:
@@ -19,7 +19,6 @@ type
|
||||
private
|
||||
FScope: IExecutionScope;
|
||||
class var
|
||||
procedure HandleTCO(var ResultValue: TDataValue);
|
||||
|
||||
protected
|
||||
// IAstVisitor methods made virtual for TDebugEvaluatorVisitor to override
|
||||
@@ -60,6 +59,7 @@ type
|
||||
|
||||
// Executes an AST with proper TCO handling. This is the main entry point.
|
||||
function Execute(const RootNode: IAstNode): TDataValue;
|
||||
class procedure HandleTCO(var ResultValue: TDataValue); static;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -149,7 +149,7 @@ begin
|
||||
Result := function(const AScope: IExecutionScope): IEvaluatorVisitor begin Result := TEvaluatorVisitor.Create(AScope); end;
|
||||
end;
|
||||
|
||||
procedure TEvaluatorVisitor.HandleTCO(var ResultValue: TDataValue);
|
||||
class procedure TEvaluatorVisitor.HandleTCO(var ResultValue: TDataValue);
|
||||
begin
|
||||
// This is the central trampoline loop for Tail Call Optimization.
|
||||
// It runs as long as the evaluation returns a thunk.
|
||||
|
||||
Reference in New Issue
Block a user