From 6def1ae9744b0f56ee04d05db622f4b2a8ca96e9 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 1 Sep 2024 11:35:38 +0300 Subject: macro fun --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d0227e8..8c4bfec 100644 --- a/src/main.c +++ b/src/main.c @@ -811,7 +811,7 @@ static int toklist_expr(struct tctx *tctx, struct toklist **toklist) if(TOKEN(tctx)->type == TOKEN_LP) depth++; else if(TOKEN(tctx)->type == TOKEN_RP) depth--; - + if(toklist) token_clone(&tokens[tokens_len++], TOKEN(tctx)); @@ -823,7 +823,7 @@ static int toklist_expr(struct tctx *tctx, struct toklist **toklist) } return 0; - + // fail: // for(size_t i = 0; i < tokens_len; i++) token_dealloc(&tokens[i]); // return 1; @@ -838,6 +838,12 @@ static struct toklist *value_to_toklist(value_t value) switch(value->type) { case VALUE_ATOM: + // fix me + if(strcmp(value->value.atom, "lambda") == 0) { + SET_TOKEN_TYPE(&token, TOKEN_LAMBDA); + break; + } + SET_TOKEN_TYPE(&token, TOKEN_ID); SET_TOKEN_VALUE(&token, id, str_alloc_copy(value->value.atom)); -- cgit v1.2.3