summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-23 16:05:45 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-23 16:05:45 -0400
commiteb8eca81e997c3fbf454a636b2097629e8e8d0ea (patch)
tree756299a9459d407148efca35bdc5df2778a23c59 /parse.c
parent9db4ea5189f6f1a8b264c9948090c822f5e008b1 (diff)
fixed problem with undeclared identifiers
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index d7bae47..66f092f 100644
--- a/parse.c
+++ b/parse.c
@@ -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;