summaryrefslogtreecommitdiff
path: root/identifiers.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-13 16:02:38 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-13 16:02:38 -0400
commit1a512580a6e433341bbeb51ec2ee04a289112909 (patch)
tree975bb0f8c71cae57600ee79559df1ff8d8e46ae8 /identifiers.c
parentd3df35312cb9caf96ab787a4ee3db2c356060e7e (diff)
started cleaning up for system
Diffstat (limited to 'identifiers.c')
-rw-r--r--identifiers.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/identifiers.c b/identifiers.c
index b5e3f46..bb30e36 100644
--- a/identifiers.c
+++ b/identifiers.c
@@ -211,27 +211,11 @@ static int ident_index_in_decl(Identifier i, Declaration *d) {
return -1;
}
-static Location ident_decl_location(File *file, Identifier i) {
- switch (i->decl_kind) {
- case IDECL_DECL:
- return i->decl->where;
- case IDECL_FOR:
- if (i == i->decl_for->index) {
- return token_location(file, i->decl_for->index_token);
- } else {
- assert(i == i->decl_for->value);
- return token_location(file, i->decl_for->value_token);
- }
- break;
- case IDECL_NONE:
- break;
- }
- assert(0);
- Location l = {0};
- return l;
+static Location ident_decl_location(Identifier i) {
+ return i->decl->where;
}
static bool ident_is_declared(Identifier i) {
- return i && i->decl_kind != IDECL_NONE;
+ return i && i->decl;
}