summaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index faffacd..eefbc45 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -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;
+}