diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 19:32:30 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 19:32:30 -0500 |
| commit | d46925dbfa8627a6a874545630c2acb6975bfdea (patch) | |
| tree | 2b726ea50adf91b668a24b25d4d9e6ec7f7c2663 /typecheck.c | |
| parent | 7355b2f7fe6f5dda2aee8feca025350146ccd0f5 (diff) | |
Cleanup of builtins
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/typecheck.c b/typecheck.c index 374efa9d..a44c60b1 100644 --- a/typecheck.c +++ b/typecheck.c @@ -133,21 +133,11 @@ type_t *get_type(env_t *env, ast_t *ast) } case Int: { auto i = Match(ast, Int); - switch (i->precision) { - case INT_64BIT: return Type(IntType, .bits=64); - case INT_32BIT: return Type(IntType, .bits=32); - case INT_16BIT: return Type(IntType, .bits=16); - case INT_8BIT: return Type(IntType, .bits=8); - default: code_err(ast, "Unsupported precision"); - } + return Type(IntType, .bits=i->bits); } case Num: { auto n = Match(ast, Num); - switch (n->precision) { - case NUM_64BIT: return Type(NumType, .bits=64); - case NUM_32BIT: return Type(NumType, .bits=32); - default: code_err(ast, "Unsupported precision"); - } + return Type(NumType, .bits=n->bits); } case HeapAllocate: { type_t *pointed = get_type(env, Match(ast, HeapAllocate)->value); |
