summaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-11 17:16:40 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-11 17:17:04 +0000
commitd2461482caf9e93d6e2bc7ff17567102f635211a (patch)
treec302d1a2e7cb829b6ed006c905db0b8bbf45f57a /src/ast
parentf9b1992795142a073cd5dc1794350fc64e9aa695 (diff)
Fixed some things. Next thing will be tests.
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/ast.c6
-rw-r--r--src/ast/ast.h16
2 files changed, 12 insertions, 10 deletions
diff --git a/src/ast/ast.c b/src/ast/ast.c
index 4688bf7..f34370e 100644
--- a/src/ast/ast.c
+++ b/src/ast/ast.c
@@ -1,9 +1,9 @@
-#include <stdlib.h>
-#include <string.h>
#include "ast.h"
-#include "zprep.h"
#include "../parser/parser.h"
+#include "zprep.h"
+#include <stdlib.h>
+#include <string.h>
typedef struct TraitReg
{
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 67dc2f3..0da2c0d 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -2,8 +2,8 @@
#ifndef AST_H
#define AST_H
-#include <stdlib.h>
#include "zprep.h"
+#include <stdlib.h>
// Forward declarations.
struct ASTNode;
@@ -129,12 +129,13 @@ struct ASTNode
int line; // Source line number for debugging.
// Type information.
- char *resolved_type; // Legacy string representation (for example: "int", "User*").
- // > Yes, 'legacy' is a thing, this is the third iteration
- // > of this project (for now).
+ char *resolved_type; // Legacy string representation (for example: "int",
+ // "User*"). > Yes, 'legacy' is a thing, this is the
+ // third iteration > of this project (for now).
Type *type_info; // Formal type object (for inference/generics).
Token token;
- Token definition_token; // For LSP: Location where the symbol used in this node was defined.
+ Token definition_token; // For LSP: Location where the symbol used in this
+ // node was defined.
union
{
@@ -375,8 +376,9 @@ struct ASTNode
char *generic_param;
char *parent;
int is_union;
- int is_packed; // @packed attribute.
- int align; // @align(N) attribute, 0 = default.
+ int is_packed; // @packed attribute.
+ int align; // @align(N) attribute, 0 = default.
+ int is_incomplete; // Forward declaration (prototype)
} strct;
struct