summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-07 23:47:45 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-07 23:47:45 -0500
commitc08e40d37be72e84e7fe0e48e6e97f95b9c1bf5e (patch)
tree06fdeb2cd1b8a88709e6075e6f26aa6b6600c64e /parse.c
parentd64fa6da5b83e770bc4877655b70982d74c37a42 (diff)
(in progress) trying to get eval recursion to work
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 7d13602..b03a213 100644
--- a/parse.c
+++ b/parse.c
@@ -1173,6 +1173,7 @@ static bool parse_expr(Parser *p, Expression *e, Token *end) {
case KW_FOR: {
e->kind = EXPR_FOR;
ForExpr *fo = e->for_ = parser_malloc(p, sizeof *fo);
+ fo->val_stack = NULL;
fo->flags = 0;
fo->value = NULL;
fo->index = NULL;
@@ -1849,7 +1850,8 @@ static bool parse_decl(Parser *p, Declaration *d, DeclEndKind ends_with, U16 fla
d->where.start = t->token;
d->idents = NULL;
d->flags = 0;
-
+ d->val_stack = NULL;
+
if ((flags & PARSE_DECL_ALLOW_EXPORT) && token_is_direct(t->token, DIRECT_EXPORT)) {
d->flags |= DECL_EXPORT;
++t->token;
@@ -2502,7 +2504,7 @@ static bool ident_is_definitely_const(Identifier i) {
Declaration *decl = i->decl;
if (i->decl_kind != IDECL_DECL || !(decl->flags & DECL_IS_CONST))
return false;
- if (i->flags & DECL_FOREIGN) {
+ if (i->decl->flags & DECL_FOREIGN) {
if (decl->foreign.lib && COMPILE_TIME_FOREIGN_FN_SUPPORT)
return true;
else