diff --git a/ASTPlayground/MainForm.pas b/ASTPlayground/MainForm.pas index fac5f0b..247d73e 100644 --- a/ASTPlayground/MainForm.pas +++ b/ASTPlayground/MainForm.pas @@ -210,7 +210,6 @@ begin FWorkspace.Repaint; FGScope := TAst.CreateScope(nil); - RegisterNativeFunctions(FGScope); end; function TForm1.CompileAst(const ANode: IAstNode; const AParentScope: IExecutionScope; out ADescriptor: IScopeDescriptor): IAstNode; diff --git a/IntfExtract/ASTApiToClipboard.bat b/IntfExtract/ASTApiToClipboard.bat index bd7ec4d..6148775 100644 --- a/IntfExtract/ASTApiToClipboard.bat +++ b/IntfExtract/ASTApiToClipboard.bat @@ -1 +1 @@ -T:\Myc\IntfExtract\Win64\Debug\ExtractPascalInterfaces.exe -c -dirs T:\Myc\dirs.txt -fc T:\Myc\Src\Ast\Myc.Ast.*.pas \ No newline at end of file +T:\Myc\IntfExtract\Win64\Debug\ExtractPascalInterfaces.exe -c -dirs T:\Myc\dirs.txt -fc T:\Myc\Src\Ast\Myc.Ast* \ No newline at end of file diff --git a/Src/AST/Myc.Ast.Evaluator.pas b/Src/AST/Myc.Ast.Evaluator.pas index 1e8617d..9d9dfc7 100644 --- a/Src/AST/Myc.Ast.Evaluator.pas +++ b/Src/AST/Myc.Ast.Evaluator.pas @@ -62,20 +62,16 @@ type function Execute(const RootNode: IAstNode): TDataValue; end; -// Registers native Delphi functions into a scope. -procedure RegisterNativeFunctions(const AScope: IExecutionScope); - implementation uses System.TypInfo, System.Generics.Defaults, - Myc.Ast, // Added + Myc.Ast, Myc.Data.Keyword, Myc.Data.Decimal, Myc.Data.Series, Myc.Data.Scalar.JSON; -// Myc.Ast.Binding.Nodes; // Removed // Helper type for TCO via trampolining. type @@ -93,34 +89,6 @@ begin Recur := ARecur; end; -// --- Native Functions Implementation --- - -function NativeCreateRecordSeries(const Args: TArray): TDataValue; -var - jsonDef: string; - recordDef: IScalarRecordDefinition; - series: IRecordSeries; -begin - if (Length(Args) <> 1) or (Args[0].Kind <> vkText) then - raise EArgumentException.Create('CreateRecordSeries requires one string argument.'); - - jsonDef := Args[0].AsText; - recordDef := TRttiAstHelper.JsonToRecordDefinition(jsonDef); - - if Length(recordDef.Fields) = 0 then - raise EArgumentException.Create('Failed to parse record definition from JSON.'); - - series := TScalarRecordSeries.Create(recordDef); - Result := TDataValue.FromRecordSeries(series); -end; - -// --- Registration Procedure --- - -procedure RegisterNativeFunctions(const AScope: IExecutionScope); -begin - AScope.Define('CreateRecordSeries', TDataValue(NativeCreateRecordSeries)); -end; - { TDynamicRecord } type diff --git a/Src/AST/Myc.Ast.Script.pas b/Src/AST/Myc.Ast.Script.pas index 7f08c7b..c2b6a74 100644 --- a/Src/AST/Myc.Ast.Script.pas +++ b/Src/AST/Myc.Ast.Script.pas @@ -1090,7 +1090,6 @@ end; procedure TPrettyPrintVisitor.VisitNop(const Node: INopNode); begin // A placeholder node, usually for UI. - //TODO Nop soll durch ein spezielles ...-Token repräsentiert werden. Analysiere, ob dies syntaktisch möglich ist. Wenn ja, soll der Parser "inoffiziell" in der Lage sein Nops zu lesen und zu erzeugen. Append('...'); end;