diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-05 18:41:13 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-05 18:41:13 -0800 |
commit | 75bffac83e8e8a30ae7643a5d830e580d1ffee65 (patch) | |
tree | 56e6ea17c8110f9383f12ef1fa03ad60ddec3962 /src/ast.c | |
parent | 346507f767d71c69e55b9f663449eb39e1bc7e54 (diff) |
add more primitives
Diffstat (limited to 'src/ast.c')
-rw-r--r-- | src/ast.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -84,3 +84,13 @@ void ast_type_print(ast_t *e) { printf("Root Node\n"); } } + +bool is_proper_list(ast_t *e) { + ast_t *cur = e; + while (cur->cdr != NULL) { + cur = cur->cdr; + } + if (cur->type == AST_PAIR && cur->car == NULL) + return true; + return false; +} |