diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-05 19:42:29 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-05 19:42:29 -0800 |
commit | 7b544da27cf99dd1de9c25f59c76d924e1878e31 (patch) | |
tree | 9ab3c2b4274fd2ed11701c2cd7309b7e1150f1f0 /src/visitor.c | |
parent | 75bffac83e8e8a30ae7643a5d830e580d1ffee65 (diff) |
silence warnings
Diffstat (limited to 'src/visitor.c')
-rw-r--r-- | src/visitor.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/visitor.c b/src/visitor.c index f6008dd..44b89ef 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -194,7 +194,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_PAIR)) { + if (arg1->type == AST_PAIR) { return arg1->car; } else eval_error(v, e); @@ -209,7 +209,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_STRING)) { + if (arg1->type == AST_STRING) { return init_ast_int(strlen(arg1->string_value)); } else eval_error(v, e); @@ -219,7 +219,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_BOOL)) { + if (arg1->type == AST_BOOL) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -229,7 +229,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_INT)) { + if (arg1->type == AST_INT) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -239,7 +239,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_FLOAT)) { + if (arg1->type == AST_FLOAT) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -249,7 +249,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_SYMBOL)) { + if (arg1->type == AST_SYMBOL) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -259,7 +259,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_FUNCTION)) { + if (arg1->type == AST_FUNCTION) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -269,7 +269,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_PAIR)) { + if (arg1->type == AST_PAIR) { return init_ast_bool(true); } else return init_ast_bool(false); @@ -279,7 +279,7 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { ast_t *arg1 = eval_expr(v, args->car); - if ((arg1->type == AST_STRING)) { + if (arg1->type == AST_STRING) { int a = atoi(arg1->string_value); return init_ast_int(a); } else @@ -436,6 +436,7 @@ ast_t *eval_expr(visitor_t *v, ast_t *e) { return eval_symbol(v, e); else { eval_error(v, e); + return NULL; } } |