summaryrefslogtreecommitdiff
path: root/main.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 /main.c
parent3aa88a917e8c44ab088498dcfc18c48e66ceb243 (diff)
Rework symbol lookup to use lexical scoping, and implement recursive function call via ∇
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index 7551958..1397003 100644
--- a/main.c
+++ b/main.c
@@ -12,8 +12,7 @@ main(int argc, char *argv[])
{
int off = 0;
stdin = Bfdopen(0, OREAD);
- globalsymtab = newsymtab();
- currentsymtab = globalsymtab;
+ initsymtab();
traceeval = 0;
debugmem = 0;
@@ -31,7 +30,10 @@ main(int argc, char *argv[])
restart:
SETUPERROR(errorcode);
if(errorcode){
- currentsymtab = globalsymtab;
+ /* remove aborted dfn frames */
+ while(getcurrentdfn())
+ popdfnframe();
+
if(globalerror.msg)
print("%S: %S\n", errorstrs[errorcode], globalerror.msg);
else