From 09a389857a017019c291583cb78f2cab29559738 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 12 Nov 2022 19:31:12 -0800 Subject: [PATCH] Hide time when reducing by steps --- lamb_engine/runner/runner.py | 21 ++++++++++++++------- pyproject.toml | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lamb_engine/runner/runner.py b/lamb_engine/runner/runner.py index bfdec96..a3944b1 100644 --- a/lamb_engine/runner/runner.py +++ b/lamb_engine/runner/runner.py @@ -196,24 +196,31 @@ class Runner: ] else: + if not self.step_reduction: + out_text += [ + ("class:ok", f"Runtime: "), + ("class:text", f"{time.time() - start_time:.03f} seconds"), + ("class:text", "\n") + ] + out_text += [ - ("class:ok", f"Runtime: "), - ("class:text", f"{time.time() - start_time:.03f} seconds"), - - ("class:ok", f"\nExit reason: "), + ("class:ok", f"Exit reason: "), stop_reason.value, + ("class:text", "\n"), - ("class:ok", f"\nMacro expansions: "), + ("class:ok", f"Macro expansions: "), ("class:text", f"{macro_expansions:,}"), + ("class:text", "\n"), - ("class:ok", f"\nReductions: "), + ("class:ok", f"Reductions: "), ("class:text", f"{k:,}\t"), ("class:muted", f"(Limit: {self.reduction_limit:,})") ] if self.full_expansion: out_text += [ - ("class:ok", "\nAll macros have been expanded") + ("class:text", "\n"), + ("class:ok", "All macros have been expanded") ] if ( diff --git a/pyproject.toml b/pyproject.toml index 507e3b3..7bc2e43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ lamb = "lamb_engine:main" [project] name = "lamb_engine" description = "A lambda calculus engine" -version = "1.1.7" +version = "1.1.8" dependencies = [ "prompt-toolkit==3.0.31", "pyparsing==3.0.9"