aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-12 01:48:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-12 01:48:45 -0500
commite5cebad467e2e807bd1c47073d57c36a9b904327 (patch)
tree12cfdea6d04f277b70c85a16f549d781776cfee8 /compile.c
parent26c89b77dbf7fc124a5b57c2d5846d249ab84a1f (diff)
Hacky kwarg implementation
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 4 insertions, 0 deletions
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);