aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-02-20 02:18:36 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2024-02-20 02:18:36 +0200
commit89a907ddd0b7f6b888c61d54e3e41a8cee00b971 (patch)
treee18577c5a1153a4c167290feb486c08d1aef3539 /include
parentb8eb76ef8efb2b000cb53d4d92d0c0df509cbdb8 (diff)
downloadek-89a907ddd0b7f6b888c61d54e3e41a8cee00b971.tar.gz
ek-89a907ddd0b7f6b888c61d54e3e41a8cee00b971.zip
expand type expansion
Diffstat (limited to 'include')
-rw-r--r--include/ek/ast.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/ek/ast.h b/include/ek/ast.h
index ab727eb..7ab03ae 100644
--- a/include/ek/ast.h
+++ b/include/ek/ast.h
@@ -370,20 +370,16 @@ struct trait_implemented {
struct trait_implemented *next;
};
-/**
- * A trait declaration.
- *
- * @todo should templates take decls or should it just be for structures?
- */
+/** A trait definition. */
struct ast_trait {
/** Name of trait. */
struct ast_node *id;
/** Parameters to construct concrete type from trait. */
struct ast_node *params;
+ /** Raw body before expansion. */
+ struct ast_node *raw_body;
/** Body of trait. */
struct ast_node *body;
- /** List of types that implement this trait. */
- struct trait_implemented *impl_by;
};
/** Cast. */
@@ -676,6 +672,7 @@ struct ast_struct {
struct ast_node *generics;
/** Body. */
struct ast_node *body;
+ struct trait_implemented *implemented_by;
};
/** Enum member constant value. */
@@ -1116,7 +1113,7 @@ struct ast_node *gen_alias(struct ast_node *id, struct ast_node *type, struct sr
* @return Corresponding AST node.
*/
struct ast_node *gen_trait(struct ast_node *id, struct ast_node *params,
- struct ast_node *body, struct src_loc loc);
+ struct ast_node *raw_body, struct ast_node *body, struct src_loc loc);
/**
* Generate import;