Add floats

This commit is contained in:
Krzosa Karol
2022-06-02 22:52:16 +02:00
parent a416007bba
commit 2909214ee0
6 changed files with 51 additions and 15 deletions

View File

@@ -295,6 +295,14 @@ ast_ident(Token *pos, Intern_String string){
return result;
}
function Ast_Atom *
ast_float(Token *pos, F64 value){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->type = type_f64; // @todo untyped
result->f64_val = value;
return result;
}
function Ast_Atom *
ast_int(Token *pos, S64 integer){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);