From 4caf4984763dd50d2bcc2f8127296df6587ea891 Mon Sep 17 00:00:00 2001 From: Danil-Zaripov Date: Fri, 6 Mar 2026 21:47:22 +0300 Subject: Improve list parsing The previous algorithm was O(n^2) --- src/ast.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ast.h') diff --git a/src/ast.h b/src/ast.h index 257024f..6124de8 100644 --- a/src/ast.h +++ b/src/ast.h @@ -46,6 +46,8 @@ Ast *ast_makeSymbol(char *name); Ast *ast_makeInt(long num); Ast *ast_makeAST(AST_ID id, Ast *left, Ast *right); Ast *ast_makeTuple(Ast *tuple); +Ast *ast_reverseList(Ast *l); +Ast *ast_addFirst(Ast *l, Ast *p); Ast *ast_addLast(Ast *l, Ast *p); Ast *ast_getNth(Ast *p,int nth); Ast *ast_getTail(Ast *p); -- cgit v1.2.3