Switched to bigint in lexer

This commit is contained in:
Krzosa Karol
2022-06-06 10:00:53 +02:00
parent 960523b443
commit 4f876a36a4
4 changed files with 46 additions and 17 deletions

View File

@@ -316,13 +316,18 @@ ast_float(Token *pos, F64 value){
}
function Ast_Atom *
ast_int(Token *pos, U64 integer){
ast_int(Token *pos, BigInt val){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->type = untyped_int;
bigint_init_unsigned(&result->big_int_val, integer);
bigint_init_bigint(&result->big_int_val, &val);
return result;
}
function Ast_Atom *
ast_int(Token *pos, U64 value){
return ast_int(pos, bigint_u64(value));
}
function Ast_Expr *
ast_expr_binary(Ast_Expr *left, Ast_Expr *right, Token *op){
AST_NEW(Binary, BINARY, op, AST_EXPR);