From 5a34bcbfbd64b396ca7994b52a06945f2911acf5 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sat, 9 Apr 2022 17:24:18 -0400 Subject: [PATCH] Add setGlobal() call to calc.c Add vgcore files to gitignore. Add tags alias to pebblisp.pbl --- .gitignore | 1 + src/calc.c | 1 + src/env.c | 1 - src/env.h | 4 +--- src/examples/pebblisp.pbl | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0eefab1..9b8e5a4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build/ tags +vgcore* *.swp *.vims pl diff --git a/src/calc.c b/src/calc.c index 76a4b2e..0e77d3d 100644 --- a/src/calc.c +++ b/src/calc.c @@ -536,6 +536,7 @@ void af(const char* name, Object (* func)(Object*, int, struct Environment*), st static struct Environment pebbleEnv() { struct Environment e = defaultEnv(); + setGlobal(&e); af("window", &add_window, &e); af("sc", &run_script, &e); af("cw", &createWindow, &e); diff --git a/src/env.c b/src/env.c index 66a2d50..5391806 100644 --- a/src/env.c +++ b/src/env.c @@ -47,7 +47,6 @@ struct helpText helpTexts[100]; struct symFunc { const char* sym; - Object (* func)(Object*, int, struct Environment*); }; diff --git a/src/env.h b/src/env.h index fe01c15..f2aaca2 100644 --- a/src/env.h +++ b/src/env.h @@ -15,12 +15,10 @@ struct EnvElement { }; struct Environment; + struct Environment { struct Environment* outer; struct ObjectTable table; - // struct EnvElement* elements; // iterative - // int capacity; // iterative - int refs; }; diff --git a/src/examples/pebblisp.pbl b/src/examples/pebblisp.pbl index 197ed30..8c6ce29 100644 --- a/src/examples/pebblisp.pbl +++ b/src/examples/pebblisp.pbl @@ -62,6 +62,7 @@ (Alias "ls" "ls --color") (Alias "alias" "(alias)") (Alias "pbl" (cat (env "EDITOR") " ~/.pebblisp.pbl")) + (Alias "tags" "ctags --exclude=node_modules -f newtags -R . && mv newtags tags") (Alias "r" "(reloadConfig)") ))