summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-23 21:16:02 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-23 21:16:02 +0000
commit9a938d3ce26b2d3728d791c0f858acdbd50223b5 (patch)
treea64151c171f0c289847c83367a678fd3252f2f99 /lexer.c
parent3aa88a917e8c44ab088498dcfc18c48e66ceb243 (diff)
Rework symbol lookup to use lexical scoping, and implement recursive function call via ∇
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lexer.c b/lexer.c
index 3be2359..f56a623 100644
--- a/lexer.c
+++ b/lexer.c
@@ -131,7 +131,7 @@ get_digits:
Rune *name = L"?";
name[0] = line[offset];
stmt->toks[stmt->ntoks].tag = NameTag;
- stmt->toks[stmt->ntoks].symbol = getsym(currentsymtab, name);
+ stmt->toks[stmt->ntoks].symbol = getsym(name);
offset++;
}else if(isalpharune(line[offset])){
Rune buf[64];
@@ -143,7 +143,7 @@ get_digits:
}
*p = 0;
stmt->toks[stmt->ntoks].tag = NameTag;
- stmt->toks[stmt->ntoks].symbol = getsym(currentsymtab, buf);
+ stmt->toks[stmt->ntoks].symbol = getsym(buf);
}else if(runestrchr(L"⎕⍞", line[offset])){
/* quad names */
Rune buf[64];