summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-04 19:45:38 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-04 19:45:38 -0800
commitc090ab2336d4f2f8536ca47a17f3e689299ea45e (patch)
tree65af756a24473f33a738398994c065d0f232ad70 /src/main.c
parent94f847851cd5fb81da18564a1b858ff20240d97a (diff)
math builtins done
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 8a3edb5..92e7764 100644
--- a/src/main.c
+++ b/src/main.c
@@ -92,11 +92,11 @@ int main(int argc, char **argv) {
/* TODO: TEST HASH TABLE COLLISIONS */
/* DONE: TEST BUILTIN FUNCTIONS */
- lexer_t *lexer = init_lexer("(+ (+ 3 4) 4)");
+ lexer_t *lexer = init_lexer("(/ (+ 3.0 4.0) 4)");
parser_t *parser = init_parser(lexer);
visitor_t *visitor = init_visitor(parser);
ast_t *root = eval(visitor);
ast_t *res = root->subnodes[0];
- printf("%d\n", res->int_value);
+ printf("%f\n", res->float_value);
return 0;
}