summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ast.c2
-rw-r--r--src/include/ast.h4
-rw-r--r--src/parser.c2
-rw-r--r--src/print.c2
-rw-r--r--src/visitor.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/ast.c b/src/ast.c
index 5325ebe..ccbf748 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -26,7 +26,7 @@ ast_t *init_ast_int(int value) {
return a;
}
-ast_t *init_ast_float(double value) {
+ast_t *init_ast_float(long double value) {
ast_t *a = init_ast(AST_FLOAT);
a->float_value = value;
return a;
diff --git a/src/include/ast.h b/src/include/ast.h
index d330ee5..77c3bc6 100644
--- a/src/include/ast.h
+++ b/src/include/ast.h
@@ -29,7 +29,7 @@ typedef struct AST_STRUCT {
char *string_value; /* Also is symbol value */
int int_value;
- double float_value;
+ long double float_value;
bool bool_value;
} ast_t;
@@ -39,7 +39,7 @@ ast_t *init_ast_string(char *value);
ast_t *init_ast_int(int value);
-ast_t *init_ast_float(double value);
+ast_t *init_ast_float(long double value);
ast_t *init_ast_pair(ast_t *car, ast_t *cdr);
diff --git a/src/parser.c b/src/parser.c
index a6a5b82..5f97ef9 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -86,7 +86,7 @@ ast_t *parse_int(parser_t *parser) {
}
ast_t *parse_float(parser_t *parser) {
- double ret = atof(parser->tokens[parser->i]->value);
+ long double ret = atof(parser->tokens[parser->i]->value);
parser_move(parser);
return init_ast_float(ret);
}
diff --git a/src/print.c b/src/print.c
index 65cfb66..d9fdbf8 100644
--- a/src/print.c
+++ b/src/print.c
@@ -13,7 +13,7 @@ void print_bool(ast_t *b) {
printf("F");
}
-void print_float(ast_t *f) { printf("%f", f->float_value); }
+void print_float(ast_t *f) { printf("%Lf", f->float_value); }
void print_symbol(ast_t *s) { printf(":%s", s->string_value); }
diff --git a/src/visitor.c b/src/visitor.c
index ffd6048..0ca29d9 100644
--- a/src/visitor.c
+++ b/src/visitor.c
@@ -94,7 +94,7 @@ ast_t *eval_symbol(visitor_t *v, ast_t *e) {
hash_table_add(v->eval_table, e->string_value, eval);
return eval;
} else {
- /* printf("symbol error\n"); */
+ printf("symbol error\n");
eval_error(v, e);
return NULL;
}