Static specialization WIP

Fix in ScopeDescriptor 2
This commit is contained in:
Michael Schimmel
2025-11-19 16:01:14 +01:00
parent 3ae1ed8f48
commit d0d1053faf
4 changed files with 79 additions and 173 deletions
+2 -2
View File
@@ -319,7 +319,7 @@ begin
// Check if we are unquoting a macro parameter (simple identifier)
if expr.Kind = akIdentifier then
begin
symbol := FMacroScope.CreateDescriptor.FindSymbol(expr.AsIdentifier.Name);
symbol := FMacroScope.Descriptor.FindSymbol(expr.AsIdentifier.Name);
if (symbol.Address.Kind = akLocalOrParent) and (symbol.Address.ScopeDepth = 0) then
begin
// It's a parameter. Return the TDataValue containing the AST node passed as argument.
@@ -519,7 +519,7 @@ begin
begin
// This is the compile-time evaluation (Binder + Evaluator)
// [*] It must bind against the *expansion* scope, not the initial scope
boundSubAst := TAstBinder.Bind(expansionScope.CreateDescriptor, ANodeToEvaluate, subDescriptor);
boundSubAst := TAstBinder.Bind(expansionScope.Descriptor, ANodeToEvaluate, subDescriptor);
// Create eval scope from the new descriptor, parented to the expansion scope
evalScope := subDescriptor.CreateScope(expansionScope);