From e275bf9ff105bbb3e12fcf15e3ab755ed0cd26cf Mon Sep 17 00:00:00 2001 From: glenda Date: Sun, 18 Sep 2022 19:58:41 +0000 Subject: Chain the symbol tables, not the dfn frames --- lexer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexer.c') diff --git a/lexer.c b/lexer.c index 45f5f5f..f684e51 100644 --- a/lexer.c +++ b/lexer.c @@ -129,13 +129,13 @@ lexline(InputStream *input, int toplevel) stmt->toks[stmt->ntoks] = allocdatum(FunctionTag, 0); stmt->toks[stmt->ntoks]->func.type = FunctypeDfn; stmt->toks[stmt->ntoks]->func.dfn = runestrdup(buf); - stmt->toks[stmt->ntoks]->func.scope = getcurrentdfn(); + stmt->toks[stmt->ntoks]->func.scope = getcurrentsymtab(); }else{ stmt->toks[stmt->ntoks] = allocdatum(oplevel == 1 ? MonadicOpTag : DyadicOpTag, 0); stmt->toks[stmt->ntoks]->operator.type = OperatortypeDop; stmt->toks[stmt->ntoks]->operator.dyadic = oplevel == 2; stmt->toks[stmt->ntoks]->operator.dop = runestrdup(buf); - stmt->toks[stmt->ntoks]->operator.scope = getcurrentdfn(); + stmt->toks[stmt->ntoks]->operator.scope = getcurrentsymtab(); } }else if(peek == '('){ int unclosed = 1; -- cgit v1.2.3