aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-12-08 14:12:52 +0000
committergingerBill <bill@gingerbill.org>2018-12-08 14:12:52 +0000
commitd05837ab6dc291ee8ee3d94b33f86a6472c5847f (patch)
tree67192ab848409750fa6371eabf7680a4800ce8d3 /src/entity.cpp
parent4369a1714e9e039abc09bdb095b8044ad2f5d2ff (diff)
Labels for block and if statements (break only)
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 707a04962..f3e11492a 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -147,8 +147,9 @@ struct Entity {
} LibraryName;
i32 Nil;
struct {
- String name;
+ String name;
Ast *node;
+ Ast *parent;
} Label;
};
};
@@ -318,9 +319,10 @@ Entity *alloc_entity_nil(String name, Type *type) {
return entity;
}
-Entity *alloc_entity_label(Scope *scope, Token token, Type *type, Ast *node) {
+Entity *alloc_entity_label(Scope *scope, Token token, Type *type, Ast *node, Ast *parent) {
Entity *entity = alloc_entity(Entity_Label, scope, token, type);
entity->Label.node = node;
+ entity->Label.parent = parent;
entity->state = EntityState_Resolved;
return entity;
}