This commit is contained in:
Reid 'arrdem' McKenzie 2021-08-21 22:25:47 -06:00
parent 6c2c9190c9
commit 2fbb0f7e1c
2 changed files with 7 additions and 10 deletions

View file

@ -122,6 +122,7 @@ parser.add_argument(
parser.add_argument("-v", "--verbose", action="count", default=0)
parser.add_argument("file", nargs="?", help="A file to start executing from")
def main():
opts, args = parser.parse_known_args()
@ -146,7 +147,11 @@ def main():
"""The implementation of the Python lang as an eval type."""
g = globals().copy()
l = {}
body = f"def _shim():\n" + "\n".join(" " + l for l in body.splitlines()) + "\n\n_escape = _shim()"
body = (
f"def _shim():\n"
+ "\n".join(" " + l for l in body.splitlines())
+ "\n\n_escape = _shim()"
)
exec(body, g, l)
return l["_escape"]

View file

@ -1,14 +1,6 @@
"""tests covering the Lilith parser."""
from lilith.parser import (
Apply,
Args,
Block,
GRAMMAR,
parse_buffer,
parser_with_transformer,
Symbol,
)
from lilith.parser import Apply, Args, Block, GRAMMAR, parse_buffer, parser_with_transformer, Symbol
import pytest