aboutsummaryrefslogtreecommitdiff
path: root/neb/std
diff options
context:
space:
mode:
Diffstat (limited to 'neb/std')
-rw-r--r--neb/std/repl.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/neb/std/repl.py b/neb/std/repl.py
index ccd48bd..b888d1a 100644
--- a/neb/std/repl.py
+++ b/neb/std/repl.py
@@ -1,4 +1,5 @@
-from .. import TypeEnum, Environment, Arg, Builtin, UserFunction, Function, evaluate, InterpretPanic, Callable, Macro
+from .. import TypeEnum, Environment, Arg, Builtin, UserFunction, Function, evaluate, InterpretPanic, Callable, Macro, lex, parse
+from .core import interpretQuote
from ..structs import *
REPL = Environment()
@@ -34,3 +35,8 @@ def interpretMacros(symbol, args, env, ns):
return List(keys)
REPL.register("macros", Builtin("macros", interpretMacros, [], return_type=Type(":list")))
+
+def interpretParseNeb(symbol, args, env, ns):
+ return interpretQuote(None, [parse(lex(args[0].value))[0]], env, ns)
+
+REPL.register("parse-neb", Builtin("parse-neb", interpretParseNeb, [Arg("string", TypeEnum.STRING)], return_type=Type(":any")))