diff options
author | kartofen <mladenovnasko0@gmail.com> | 2024-09-01 11:35:38 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2024-09-01 11:35:38 +0300 |
commit | 6def1ae9744b0f56ee04d05db622f4b2a8ca96e9 (patch) | |
tree | 8bfb703787bc401277db9fe7803120e04070ac24 /src/main.c | |
parent | 329166705de225bc766e56cc77765430065c456d (diff) |
macro fun
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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)); |