summaryrefslogtreecommitdiff
path: root/src/ast/ast.h
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-19 12:53:47 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-19 12:53:47 +0000
commit639c6ac65a1bd44b2ba0725fe7016a4920bf0950 (patch)
tree47703f960633d3d4580022583134c28b96d5f36e /src/ast/ast.h
parent526b7748cafcb5a00f8e30df88661f6059d79843 (diff)
Iterables and iterators :D
Diffstat (limited to 'src/ast/ast.h')
-rw-r--r--src/ast/ast.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ast/ast.h b/src/ast/ast.h
index cef68c6..2233b09 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -54,13 +54,17 @@ typedef struct Type
struct Type **args; // For GENERIC args.
int arg_count;
int is_const;
- int is_explicit_struct; // e.g. "struct Foo" vs "Foo"
+ int is_explicit_struct; // for example, "struct Foo" vs "Foo"
union
{
int array_size; // For fixed-size arrays [T; N].
int is_varargs; // For function types (...).
int is_restrict; // For restrict pointers.
- int has_drop; // For RAII: does this type implement Drop?
+ struct
+ {
+ int has_drop; // For RAII: does this type implement Drop?
+ int has_iterable; // For the for iterator: does the type implement Iterable?
+ } traits;
};
} Type;
@@ -404,6 +408,8 @@ struct ASTNode
{
char *name;
ASTNode *methods;
+ char **generic_params;
+ int generic_param_count;
} trait;
struct