From 9201d978d0c4d4f4bdffd4e686ef116d7fdaa982 Mon Sep 17 00:00:00 2001 From: czjstmax Date: Sun, 21 Dec 2025 21:24:46 +0100 Subject: Fixed `#include` directives for `heads/` folder in `rbc.c` Signed-off-by: czjstmax --- src/rbc.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/rbc.c') diff --git a/src/rbc.c b/src/rbc.c index 5316cda..1e6a3de 100644 --- a/src/rbc.c +++ b/src/rbc.c @@ -46,17 +46,18 @@ * Debug compile = 'cc rbc.c -o crbc -g -O0 -Wall -Wextra -pedantic -fsanitize=address,undefined' */ +// Include directives #include #include #include // 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; } -- cgit v1.3.1