diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-13 23:12:20 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-13 23:12:20 -0500 |
| commit | 1f2b288b32b61dca84fa39eb048e30fbee1262aa (patch) | |
| tree | d8afc5020337d6bb253461a41bc192343da91a28 /compile.c | |
| parent | b3f61e16ce3c156a19b8a07ebca17e95cd919c35 (diff) | |
Slightly more concise generated code for ints
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -34,7 +34,7 @@ CORD compile(env_t *env, ast_t *ast) case Nil: return CORD_asprintf("(%r)NULL", compile_type(env, Match(ast, Nil)->type)); case Bool: return Match(ast, Bool)->b ? "yes" : "no"; case Var: return Match(ast, Var)->name; - case Int: return CORD_asprintf("((Int%ld_t)%ld)", Match(ast, Int)->precision, Match(ast, Int)->i); + case Int: return CORD_asprintf("I%ld(%ld)", Match(ast, Int)->precision, Match(ast, Int)->i); case Num: return CORD_asprintf(Match(ast, Num)->precision == 64 ? "%g" : "%gf", Match(ast, Num)->n); case UnaryOp: { auto unop = Match(ast, UnaryOp); |
