Fix in Scripting

This commit is contained in:
Michael Schimmel
2025-09-23 12:51:55 +02:00
parent 2f2c93d56e
commit 46d40cfbca
3 changed files with 24 additions and 11 deletions
+1 -8
View File
@@ -39,8 +39,8 @@ type
procedure EnterScope;
procedure ExitScope;
function GetCurrentDescriptor: IScopeDescriptor;
function IsValidIdentifier(const Name: string): Boolean;
protected
// Stack management for tail-call state is centralized here.
function Accept(const Node: IAstNode): TDataValue; override;
@@ -65,8 +65,6 @@ type
function TransformTernaryExpression(const Node: ITernaryExpressionNode): ITernaryExpressionNode; override;
function TransformBinaryExpression(const Node: IBinaryExpressionNode): IBinaryExpressionNode; override;
function TransformUnaryExpression(const Node: IUnaryExpressionNode): IUnaryExpressionNode; override;
property CurrentDescriptor: IScopeDescriptor read GetCurrentDescriptor;
end;
TBoundIdentifierNode = class(TIdentifierNode)
@@ -251,11 +249,6 @@ begin
FCurrentDescriptor := FCurrentDescriptor.Parent;
end;
function TAstBinder.GetCurrentDescriptor: IScopeDescriptor;
begin
Result := FCurrentDescriptor;
end;
function TAstBinder.IsValidIdentifier(const Name: string): Boolean;
var
c: Char;
+2 -2
View File
@@ -25,14 +25,14 @@ type
TEvaluatorVisitor = class(TAstVisitor, IEvaluatorVisitor)
private
FScope: IExecutionScope;
procedure HandleTCO(var ResultValue: TDataValue);
protected
function IsTruthy(const AValue: TDataValue): Boolean; inline;
// Returns a closure that can create the correct type of visitor for a lambda's body.
function CreateVisitorFactory: TVisitorFactory; virtual;
procedure HandleTCO(var ResultValue: TDataValue);
property Scope: IExecutionScope read FScope;
public
constructor Create(const AScope: IExecutionScope);