diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-24 17:59:37 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-24 17:59:37 -0400 |
| commit | 7cb55ec0061246685ffe8c6d1d92307495c28943 (patch) | |
| tree | 6e1b1dec1ecac8660068887c320de9e737d65249 /src | |
| parent | 56959100a677369eca0261b47ec7299e9a8d1207 (diff) | |
Finally, split compile.c into compile/expressions.c
Diffstat (limited to 'src')
| -rw-r--r-- | src/compile.h | 12 | ||||
| -rw-r--r-- | src/compile/assignments.c | 2 | ||||
| -rw-r--r-- | src/compile/binops.c | 2 | ||||
| -rw-r--r-- | src/compile/blocks.c | 2 | ||||
| -rw-r--r-- | src/compile/cli.c | 2 | ||||
| -rw-r--r-- | src/compile/declarations.c | 2 | ||||
| -rw-r--r-- | src/compile/enums.c | 2 | ||||
| -rw-r--r-- | src/compile/expressions.c (renamed from src/compile.c) | 55 | ||||
| -rw-r--r-- | src/compile/expressions.h | 11 | ||||
| -rw-r--r-- | src/compile/functions.c | 2 | ||||
| -rw-r--r-- | src/compile/integers.c | 2 | ||||
| -rw-r--r-- | src/compile/lists.c | 2 | ||||
| -rw-r--r-- | src/compile/optionals.c | 2 | ||||
| -rw-r--r-- | src/compile/pointers.c | 2 | ||||
| -rw-r--r-- | src/compile/promotions.c | 2 | ||||
| -rw-r--r-- | src/compile/sets.c | 2 | ||||
| -rw-r--r-- | src/compile/statements.c | 2 | ||||
| -rw-r--r-- | src/compile/structs.c | 2 | ||||
| -rw-r--r-- | src/compile/tables.c | 2 | ||||
| -rw-r--r-- | src/compile/text.c | 2 |
20 files changed, 54 insertions, 58 deletions
diff --git a/src/compile.h b/src/compile.h deleted file mode 100644 index 18143e25..00000000 --- a/src/compile.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -// Compilation functions - -#include "ast.h" -#include "environment.h" -#include "stdlib/datatypes.h" -#include "types.h" - -Text_t compile(env_t *env, ast_t *ast); -Text_t compile_empty(type_t *t); -Text_t compile_maybe_incref(env_t *env, ast_t *ast, type_t *t); diff --git a/src/compile/assignments.c b/src/compile/assignments.c index c7e61e26..e0bbc9fe 100644 --- a/src/compile/assignments.c +++ b/src/compile/assignments.c @@ -1,7 +1,7 @@ // This file defines how to compile assignments #include "assignments.h" #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/binops.c b/src/compile/binops.c index 38fb52db..469ef60c 100644 --- a/src/compile/binops.c +++ b/src/compile/binops.c @@ -1,7 +1,7 @@ // This file defines how to compile binary operations #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/blocks.c b/src/compile/blocks.c index eea73562..c533c801 100644 --- a/src/compile/blocks.c +++ b/src/compile/blocks.c @@ -2,7 +2,7 @@ #include "blocks.h" #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/cli.c b/src/compile/cli.c index cccee5a5..d9299bae 100644 --- a/src/compile/cli.c +++ b/src/compile/cli.c @@ -1,6 +1,6 @@ // This file defines how to compile CLI argument parsing -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/declarations.c b/src/compile/declarations.c index cb961db0..8ea58ce2 100644 --- a/src/compile/declarations.c +++ b/src/compile/declarations.c @@ -1,6 +1,6 @@ // This file defines how to compile variable declarations #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/enums.c b/src/compile/enums.c index 12b58b26..85b29e4b 100644 --- a/src/compile/enums.c +++ b/src/compile/enums.c @@ -1,7 +1,7 @@ // This file defines how to compile enums #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../naming.h" #include "../stdlib/tables.h" diff --git a/src/compile.c b/src/compile/expressions.c index 38f40ba1..28db606b 100644 --- a/src/compile.c +++ b/src/compile/expressions.c @@ -1,32 +1,29 @@ -// Compilation logic -#include <gc.h> -#include <stdio.h> -#include <uninorm.h> - -#include "ast.h" -#include "compile.h" -#include "compile/binops.h" -#include "compile/blocks.h" -#include "compile/declarations.h" -#include "compile/enums.h" -#include "compile/functions.h" -#include "compile/integers.h" -#include "compile/lists.h" -#include "compile/optionals.h" -#include "compile/pointers.h" -#include "compile/promotions.h" -#include "compile/sets.h" -#include "compile/statements.h" -#include "compile/structs.h" -#include "compile/tables.h" -#include "compile/text.h" -#include "compile/types.h" -#include "config.h" -#include "environment.h" -#include "stdlib/tables.h" -#include "stdlib/text.h" -#include "stdlib/util.h" -#include "typecheck.h" +// This file defines logic for compiling expressions + +#include "expressions.h" +#include "../ast.h" +#include "../config.h" +#include "../environment.h" +#include "../stdlib/tables.h" +#include "../stdlib/text.h" +#include "../stdlib/util.h" +#include "../typecheck.h" +#include "binops.h" +#include "blocks.h" +#include "declarations.h" +#include "enums.h" +#include "functions.h" +#include "integers.h" +#include "lists.h" +#include "optionals.h" +#include "pointers.h" +#include "promotions.h" +#include "sets.h" +#include "statements.h" +#include "structs.h" +#include "tables.h" +#include "text.h" +#include "types.h" public Text_t compile_maybe_incref(env_t *env, ast_t *ast, type_t *t) { diff --git a/src/compile/expressions.h b/src/compile/expressions.h new file mode 100644 index 00000000..86bc110f --- /dev/null +++ b/src/compile/expressions.h @@ -0,0 +1,11 @@ +// This file defines logic for compiling expressions +#pragma once + +#include "../ast.h" +#include "../environment.h" +#include "../stdlib/datatypes.h" +#include "../types.h" + +Text_t compile(env_t *env, ast_t *ast); +Text_t compile_empty(type_t *t); +Text_t compile_maybe_incref(env_t *env, ast_t *ast, type_t *t); diff --git a/src/compile/functions.c b/src/compile/functions.c index 33ea9f98..6fc626cf 100644 --- a/src/compile/functions.c +++ b/src/compile/functions.c @@ -2,7 +2,7 @@ #include "functions.h" #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../naming.h" #include "../stdlib/datatypes.h" diff --git a/src/compile/integers.c b/src/compile/integers.c index 40351afa..10955fe1 100644 --- a/src/compile/integers.c +++ b/src/compile/integers.c @@ -3,7 +3,7 @@ #include <gmp.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/integers.h" diff --git a/src/compile/lists.c b/src/compile/lists.c index e5c5dcca..a44d9098 100644 --- a/src/compile/lists.c +++ b/src/compile/lists.c @@ -6,7 +6,7 @@ #include <uninorm.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../config.h" #include "../environment.h" #include "../stdlib/text.h" diff --git a/src/compile/optionals.c b/src/compile/optionals.c index 6dd5c2b7..0c844c75 100644 --- a/src/compile/optionals.c +++ b/src/compile/optionals.c @@ -1,6 +1,6 @@ // This file defines how to compile optionals and null -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../naming.h" #include "../stdlib/datatypes.h" diff --git a/src/compile/pointers.c b/src/compile/pointers.c index 317863af..54e24f63 100644 --- a/src/compile/pointers.c +++ b/src/compile/pointers.c @@ -6,7 +6,7 @@ #include <uninorm.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../config.h" #include "../environment.h" #include "../stdlib/text.h" diff --git a/src/compile/promotions.c b/src/compile/promotions.c index d017568a..eff946b9 100644 --- a/src/compile/promotions.c +++ b/src/compile/promotions.c @@ -2,7 +2,7 @@ #include "promotions.h" #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/sets.c b/src/compile/sets.c index b6144662..f9ffa0ae 100644 --- a/src/compile/sets.c +++ b/src/compile/sets.c @@ -1,7 +1,7 @@ // This file defines how to compile sets #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/statements.c b/src/compile/statements.c index 2e46e42b..7683b552 100644 --- a/src/compile/statements.c +++ b/src/compile/statements.c @@ -3,7 +3,7 @@ #include <glob.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../config.h" #include "../environment.h" #include "../modules.h" diff --git a/src/compile/structs.c b/src/compile/structs.c index 2dc4a60b..20f40c4d 100644 --- a/src/compile/structs.c +++ b/src/compile/structs.c @@ -3,7 +3,7 @@ #include <gc.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../naming.h" #include "../stdlib/tables.h" diff --git a/src/compile/tables.c b/src/compile/tables.c index 8ea86a27..e9067c0f 100644 --- a/src/compile/tables.c +++ b/src/compile/tables.c @@ -1,7 +1,7 @@ // This file defines how to compile tables #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../stdlib/datatypes.h" #include "../stdlib/text.h" diff --git a/src/compile/text.c b/src/compile/text.c index a6d739ad..c08ef31e 100644 --- a/src/compile/text.c +++ b/src/compile/text.c @@ -2,7 +2,7 @@ #include <ctype.h> #include "../ast.h" -#include "../compile.h" +#include "expressions.h" #include "../environment.h" #include "../naming.h" #include "../stdlib/datatypes.h" |
