diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-23 16:05:45 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-23 16:05:45 -0400 |
commit | eb8eca81e997c3fbf454a636b2097629e8e8d0ea (patch) | |
tree | 756299a9459d407148efca35bdc5df2778a23c59 /parse.c | |
parent | 9db4ea5189f6f1a8b264c9948090c822f5e008b1 (diff) |
fixed problem with undeclared identifiers
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1011,7 +1011,7 @@ static Identifier parser_ident_insert(Parser *p, char *str) { static Status check_ident_redecl(Parser *p, Identifier i) { Tokenizer *t = p->tokr; - if (ident_is_declared(i)) { + if (i->decl) { char *s = ident_to_str(i); tokr_err(t, "Redeclaration of identifier %s.", s); info_print(ident_decl_location(i), "Previous declaration was here."); @@ -2944,8 +2944,8 @@ static inline Type *decl_type_at_index(Declaration *d, int i) { } static inline bool ident_is_definitely_const(Identifier i) { - assert(ident_is_declared(i)); Declaration *decl = i->decl; + assert(decl); if (!(decl->flags & DECL_IS_CONST)) return false; |