From d8d86dded538fb503eab413a43ae2829e41f8e15 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Sat, 28 Jan 2023 18:54:15 +0900 Subject: v0.10.4 --- src/ast.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index ca020f1..e776764 100644 --- a/src/ast.c +++ b/src/ast.c @@ -309,7 +309,7 @@ void ast_puts(Ast *p) { } -Ast *ast_unfoldABR(Ast *left_params, char *sym, Ast *paramlist) { +Ast *ast_unfoldABR(Ast *left_params, char *sym, Ast *paramlist, Ast *annotate) { // input: // left_params << (AST_AGENT, sym, paramlist) @@ -384,8 +384,13 @@ Ast *ast_unfoldABR(Ast *left_params, char *sym, Ast *paramlist) { } // ast_puts(left);puts(""); - + Ast *agent_left = ast_makeAST(AST_AGENT, ast_makeSymbol(sym), left_params); + if (annotate != NULL) { + // replace (AST_ANNOTATE NULL NULL) with (AST_ANNOTATE agent_left NULL) + annotate->left = agent_left; + agent_left = annotate; + } Ast *agent_right = param; Ast *cnct = ast_makeAST(AST_CNCT, agent_left, agent_right); -- cgit v1.2.3