diff options
| author | mryouse | 2022-05-10 05:05:39 +0000 |
|---|---|---|
| committer | mryouse | 2022-05-10 05:05:39 +0000 |
| commit | fcff78ad45953c2473270c928e0256917f30d5c2 (patch) | |
| tree | fcbac87029def35873453208082b2e806b6093a5 /repl.py | |
| parent | b9db8d7c741ca81e71a56e84b030c67659597735 (diff) | |
add debug toggle
Diffstat (limited to 'repl.py')
| -rw-r--r-- | repl.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,6 +1,8 @@ from lexer import lex from parser import parse from runner import evaluate +from std import _get_debug + def main(): idx = 1 @@ -10,9 +12,11 @@ def main(): continue try: lexed = lex(inp, []) - print(f" - LEX: {lexed}") + if _get_debug(): + print(f" - LEX: {lexed}") parsed = parse(lexed, []) - print(f" - PARSE: {parsed}") + if _get_debug(): + print(f" - PARSE: {parsed}") ev = evaluate(parsed, []) print(f"=> {ev}") idx += 1 |
