Labels for block and if statements (break only)

This commit is contained in:
gingerBill
2018-12-08 14:12:52 +00:00
parent 4369a1714e
commit d05837ab6d
6 changed files with 97 additions and 22 deletions

View File

@@ -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;
}