Ast Binding
This commit is contained in:
@@ -101,9 +101,20 @@ type
|
||||
function GetParent: IExecutionScope;
|
||||
{$endregion}
|
||||
procedure Clear;
|
||||
function FindValue(const Name: string; out Value: TAstValue): Boolean;
|
||||
procedure SetValue(const Name: string; const Value: TAstValue);
|
||||
procedure AssignValue(const Name: string; const Value: TAstValue);
|
||||
|
||||
// --- Legacy name-based access (for pre-binder setup, e.g., native functions) ---
|
||||
function FindValue(const Name: string; out Value: TAstValue): Boolean; deprecated 'Use index-based access after binding.';
|
||||
procedure SetValue(const Name: string; const Value: TAstValue); deprecated 'Use Define for script variables.';
|
||||
procedure AssignValue(const Name: string; const Value: TAstValue); overload; deprecated 'Use index-based assignment after binding.';
|
||||
|
||||
// --- New index-based access (for use by the evaluator after binding) ---
|
||||
// Defines a new variable in the current scope.
|
||||
procedure Define(const Name: string; const Value: TAstValue);
|
||||
// Gets a value from a scope at a specific depth and slot index.
|
||||
function GetValue(Depth, Index: Integer): TAstValue;
|
||||
// Assigns a new value to an existing variable at a specific depth and slot index.
|
||||
procedure AssignValue(Depth, Index: Integer; const Value: TAstValue); overload;
|
||||
|
||||
function Dump: string;
|
||||
property Parent: IExecutionScope read GetParent;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user