diff options
| author | czjstmax <jstmaxlol@disroot.org> | 2025-12-21 21:24:46 +0100 |
|---|---|---|
| committer | czjstmax <jstmaxlol@disroot.org> | 2025-12-21 21:24:46 +0100 |
| commit | 9201d978d0c4d4f4bdffd4e686ef116d7fdaa982 (patch) | |
| tree | d78d98f3b157d39b2353165445b4a47569658da0 /src/rbc.c | |
| parent | 05033cc80fc9839e402106ae60e92b69266d1595 (diff) | |
Fixed `#include` directives for `heads/` folder in `rbc.c`
Signed-off-by: czjstmax <jstmaxlol@disroot.org>
Diffstat (limited to 'src/rbc.c')
| -rw-r--r-- | src/rbc.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -46,17 +46,18 @@ * Debug compile = 'cc rbc.c -o crbc -g -O0 -Wall -Wextra -pedantic -fsanitize=address,undefined' */ +// Include directives #include <stdio.h> #include <stdlib.h> #include <string.h> // git@github.com:jstmaxlol/kat -#include "headers/kat.h" +#include "heads/kat.h" // CReborn headers (CReborn APIs) -#include "headers/codegen.h" -#include "headers/abstract.h" -#include "headers/freeast.h" +#include "heads/codegen.h" +#include "heads/abstract.h" +#include "heads/freeast.h" // ASTs in abstract.h // @@ -81,26 +82,26 @@ int main(int argc, char **argv) { printf(":> No arguments were found. (%d)\n\n", argc-1); } - const char *ident_buff = "number"; - const char *type_buff = "int"; + const char *identBuff = "number"; + const char *typeBuff = "int"; - int value_buff = 2; + int valueBuff = 2; if (argc == 3) { if (strlen(argv[1]) >= 1) - ident_buff = argv[1]; + identBuff = argv[1]; //if (strlen(argv[2]) >= 1) - // type_buff = argv[2]; + // typeBuff = argv[2]; if (strlen(argv[2]) >= 1) - value_buff = atoi(argv[2]); + valueBuff = atoi(argv[2]); } - Expr *e = ExprIntLiteral(value_buff); - Decl *decl = DeclareVariable(ident_buff, type_buff, e); + Expr *e = ExprIntLiteral(valueBuff); + Decl *decl = DeclareVariable(identBuff, typeBuff, e); if (decl->kind == DECL_VAR) { DeclVar *v = decl->as; - printf("v->ident=%s, v->type=%s\nlet %s: %s = %d;", v->ident, v->type, v->ident, v->type, value_buff); + printf("v->ident=%s, v->type=%s\nlet %s: %s = %d;", v->ident, v->type, v->ident, v->type, valueBuff); } FreeExpr(e); @@ -112,6 +113,8 @@ int main(int argc, char **argv) { // Functions (definitions) // static inline int Eval(int x) { + // TODO + // (work on this after AST is finished) return x; } |