summaryrefslogtreecommitdiff
path: root/identifiers.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-09-18 11:36:40 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-09-18 11:36:40 -0400
commitad062bd0ad547447f74840b89fb0dced35be0fdc (patch)
tree97cb1673ec68fa8aaad9d1c15687c15e9b70b9c5 /identifiers.c
parent9e9bd1823942e0b5e93cb3866799e7d336f2bb0d (diff)
improved fn params
Diffstat (limited to 'identifiers.c')
-rw-r--r--identifiers.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/identifiers.c b/identifiers.c
index eb82c7b..0f083c0 100644
--- a/identifiers.c
+++ b/identifiers.c
@@ -177,6 +177,15 @@ static char *ident_to_str(Identifier i) {
return str;
}
+static void ident_add_decl(Identifier i, struct Declaration *d, struct Block *b) {
+ if (!i->decls.item_sz) {
+ arr_create(&i->decls, sizeof(IdentDecl));
+ }
+ IdentDecl *id_decl = arr_add(&i->decls);
+ id_decl->decl = d;
+ id_decl->scope = b;
+}
+
static IdentDecl *ident_decl(Identifier i) {
assert(i->decls.item_sz);
return (IdentDecl*)arr_last(&i->decls);