diff options
| author | mryouse | 2022-05-18 03:07:23 +0000 |
|---|---|---|
| committer | mryouse | 2022-05-18 03:07:23 +0000 |
| commit | 5d1298d100888173ad98fbc5b9a0725ed78cd1a5 (patch) | |
| tree | 3755c61ea9b76f1589d8174e9a9555bf438a3b07 /repl.py | |
| parent | 8906deac1ad119f7b8b07eb476be500d7f454fee (diff) | |
rewrite of lexer, using a measured approach
Diffstat (limited to 'repl.py')
| -rw-r--r-- | repl.py | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -1,8 +1,7 @@ from lexer import lex -from parser import parse -from runner import evaluate -from std import _get_debug +def _get_debug(): + return True def main(): print("### neb :)(:") @@ -13,16 +12,11 @@ def main(): if len(inp.strip()) == 0: continue try: - lexed = lex(inp, []) + lexed = lex(inp) + #lexed = lex(inp, []) if _get_debug(): acc = " ".join([f"{l}" for l in lexed]) print(f" - LEX: {acc}") - parsed = parse(lexed, []) - if _get_debug(): - acc = " ".join([f"{p}" for p in parsed]) - print(f" - PARSE: {acc}") - ev = evaluate(parsed, []) - print(f"=> {ev}") idx += 1 except Exception as e: print(f"panic! {e}") |
