Binder refactoring - extracted TCO - WIP
This commit is contained in:
@@ -41,6 +41,7 @@ uses
|
||||
Myc.Ast.MacroExpander,
|
||||
Myc.Ast.TypeChecker,
|
||||
Myc.Ast.Lowering,
|
||||
Myc.Ast.Compiler.TCO,
|
||||
FMX.DialogService,
|
||||
FMX.ListView.Types,
|
||||
FMX.ListView.Appearances,
|
||||
@@ -214,7 +215,7 @@ end;
|
||||
function TForm1.CompileAst(const ANode: IAstNode; const AParentScope: IExecutionScope; out ADescriptor: IScopeDescriptor): IAstNode;
|
||||
var
|
||||
macroDescriptor: IScopeDescriptor;
|
||||
expandedAst, boundAst, typedAst: IAstNode;
|
||||
expandedAst, boundAst, typedAst, loweredAst: IAstNode;
|
||||
begin
|
||||
// Step 1: Expand macros (Phase 1)
|
||||
expandedAst := TMacroExpander.ExpandMacros(AParentScope, ANode, macroDescriptor, CreateEvaluator);
|
||||
@@ -226,7 +227,10 @@ begin
|
||||
typedAst := TTypeChecker.CheckTypes(boundAst, ADescriptor);
|
||||
|
||||
// Step 4: Lowering / Canonicalization (Phase 4)
|
||||
Result := TAstLowerer.Lower(typedAst);
|
||||
loweredAst := TAstLowerer.Lower(typedAst);
|
||||
|
||||
// Step 5: Tail Call Optimization (Phase 5)
|
||||
Result := TAstTCO.Optimize(loweredAst);
|
||||
end;
|
||||
|
||||
function TForm1.ExecuteAst(const ANode: IAstNode; const AParentScope: IExecutionScope): TDataValue;
|
||||
|
||||
Reference in New Issue
Block a user