From d46925dbfa8627a6a874545630c2acb6975bfdea Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Feb 2024 19:32:30 -0500 Subject: Cleanup of builtins --- parse.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index b9d4ef9b..571f5676 100644 --- a/parse.c +++ b/parse.c @@ -420,19 +420,19 @@ PARSER(parse_int) { if (match(&pos, "%")) { double d = (double)i / 100.; - return NewAST(ctx->file, start, pos, Num, .n=d, .precision=64); + return NewAST(ctx->file, start, pos, Num, .n=d, .bits=64); } match(&pos, "_"); - int64_t precision = 64; - if (match(&pos, "i64")) precision = 64; - else if (match(&pos, "i32")) precision = 32; - else if (match(&pos, "i16")) precision = 16; - else if (match(&pos, "i8")) precision = 8; + int64_t bits = 64; + if (match(&pos, "i64")) bits = 64; + else if (match(&pos, "i32")) bits = 32; + else if (match(&pos, "i16")) bits = 16; + else if (match(&pos, "i8")) bits = 8; // else if (match(&pos, ".") || match(&pos, "e")) return NULL; // looks like a float - return NewAST(ctx->file, start, pos, Int, .i=i, .precision=precision); + return NewAST(ctx->file, start, pos, Int, .i=i, .bits=bits); } type_ast_t *parse_table_type(parse_ctx_t *ctx, const char *pos) { @@ -558,16 +558,16 @@ PARSER(parse_num) { if (negative) d *= -1; - int64_t precision = 64; + int64_t bits = 64; match(&pos, "_"); - if (match(&pos, "f64")) precision = 64; - else if (match(&pos, "f32")) precision = 32; + if (match(&pos, "f64")) bits = 64; + else if (match(&pos, "f32")) bits = 32; if (match(&pos, "%")) { d /= 100.; } - return NewAST(ctx->file, start, pos, Num, .n=d, .precision=precision); + return NewAST(ctx->file, start, pos, Num, .n=d, .bits=bits); } static inline bool match_separator(const char **pos) { // Either comma or newline @@ -1606,7 +1606,7 @@ PARSER(parse_func_def) { if (match_word(&pos, "inline")) { is_inline = true; } else if (match_word(&pos, "cached")) { - if (!cache_ast) cache_ast = NewAST(ctx->file, pos, pos, Int, .i=INT64_MAX, .precision=64); + if (!cache_ast) cache_ast = NewAST(ctx->file, pos, pos, Int, .i=INT64_MAX, .bits=64); } else if (match_word(&pos, "cache_size")) { if (whitespace(&pos), !match(&pos, "=")) parser_err(ctx, flag_start, pos, "I expected a value for 'cache_size'"); -- cgit v1.2.3