From e5cebad467e2e807bd1c47073d57c36a9b904327 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 12 Feb 2024 01:48:45 -0500 Subject: Hacky kwarg implementation --- Makefile | 4 ++-- compile.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 117ce493..e2b77a44 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,8 @@ libnext.so: metamethods/cord.o util.o SipHash/halfsiphash.o SipHash/halfsiphash.c: git submodule update --init --recursive -tags: $(wildcard **/*.[ch]) - ctags **/*.[ch] +tags: + ctags *.[ch] **/*.[ch] clean: rm -f nextlang *.o diff --git a/compile.c b/compile.c index 19a497fe..843dba05 100644 --- a/compile.c +++ b/compile.c @@ -215,6 +215,10 @@ CORD compile(ast_t *ast) return CORD_cat_char(code, ')'); } // Lambda, + case KeywordArg: { + auto kwarg = Match(ast, KeywordArg); + return CORD_asprintf(".%s=%r", kwarg->name, compile(kwarg->arg)); + } // KeywordArg, case If: { auto if_ = Match(ast, If); -- cgit v1.2.3