diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-27 19:05:05 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-27 19:05:05 +0100 |
commit | 816f6d2bd816d4d84413f4bf6cb17198ad1aa39b (patch) | |
tree | 429d49cc0cfc9f74daad9e65a53b9250ade816c1 /src/Compile.hs | |
parent | f8b2091aed6ca42a0cf1fa7b6a920f6c3a5227a9 (diff) |
Compile: Fix formatting of generated code
Diffstat (limited to 'src/Compile.hs')
-rw-r--r-- | src/Compile.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Compile.hs b/src/Compile.hs index 6e46f74..908b304 100644 --- a/src/Compile.hs +++ b/src/Compile.hs @@ -352,21 +352,21 @@ compileToString env expr = ,compose [printStructDecl sd . showString "\n" | sd <- structs] ,showString "\n" ,showString "static void* malloc_instr(size_t n) {\n" - ,showString " void *ptr = malloc(n);" + ,showString " void *ptr = malloc(n);\n" ,if debugAllocs then showString "printf(\"[chad-kernel] malloc(%zu) -> %p\\n\", n, ptr);\n" else id - ,showString " return ptr;" + ,showString " return ptr;\n" ,showString "}\n" ,showString "static void* calloc_instr(size_t n) {\n" - ,showString " void *ptr = calloc(n, 1);" + ,showString " void *ptr = calloc(n, 1);\n" ,if debugAllocs then showString "printf(\"[chad-kernel] calloc(%zu) -> %p\\n\", n, ptr);\n" else id - ,showString " return ptr;" + ,showString " return ptr;\n" ,showString "}\n" ,showString "static void free_instr(void *ptr) {\n" ,if debugAllocs then showString "printf(\"[chad-kernel] free(%p)\\n\", ptr);\n" else id - ,showString " free(ptr);" + ,showString " free(ptr);\n" ,showString "}\n\n" ,compose [showString str . showString "\n\n" | str <- toList (csTopLevelDecls s)] ,showString $ |