aboutsummaryrefslogtreecommitdiff
path: root/neb.py
diff options
context:
space:
mode:
Diffstat (limited to 'neb.py')
-rw-r--r--neb.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/neb.py b/neb.py
index cd60cb8..d9b40ae 100644
--- a/neb.py
+++ b/neb.py
@@ -3,6 +3,7 @@ from neb import lex, parse, interpret, NebPanic, Environment, MultiFunction, Bui
from neb.std import *
import sys
import readline
+from pathlib import Path
class NebCompleter:
@@ -90,6 +91,19 @@ def repl():
readline.set_completer(cmp.complete)
readline.set_completer_delims(" ()")
+ initfil = Path("~/.local/share/neb/init.neb").expanduser()
+ if initfil.exists():
+ try:
+ lexed = lex(f'(use "{initfil}")')
+ parsed = parse(lexed)
+ ev = interpret(parsed, env)
+ except NebPanic as ne:
+ print(f"panic! {ne}")
+ return
+ except Exception as e:
+ print(f"exception! {type(e)} {e}")
+ return
+
print("### neb :)(:")
print("version: < 0")
idx = 1