added _main
This commit is contained in:
@@ -123,7 +123,11 @@ class Clyx:
|
||||
run = lambda self, code: self._exec_quot(self._tokenize(code))
|
||||
|
||||
def clyx(f):
|
||||
try: Clyx().run(open(f).read())
|
||||
try:
|
||||
c = Clyx()
|
||||
c.run(open(f).read())
|
||||
if '_main' in c._words:
|
||||
c.run('_main')
|
||||
except Exception as e: (sys.stderr.write(f'Error executing {f}: {e}\n'), sys.exit(1))
|
||||
|
||||
repl = lambda: clyx(replpath)
|
||||
|
||||
Reference in New Issue
Block a user