Fixed parser, added macro printout

This commit is contained in:
2022-10-21 19:55:15 -07:00
parent ee744b5245
commit 8558c484c5
5 changed files with 49 additions and 37 deletions

10
main.py
View File

@@ -43,7 +43,7 @@ r.run_lines([
"OR = λab.(a T b)",
"XOR = λab.(a (NOT a b) b)",
"w = λx.(x x)",
"W = (w w)",
"W = w w",
"Y = λf.( (λx.(f (x x))) (λx.(f (x x))) )",
"PAIR = λabi.( i a b )",
"inc = λnfa.(f (n f a))",
@@ -90,7 +90,13 @@ while True:
# If this line defined a macro, print nothing.
if isinstance(x, runner.MacroStatus):
pass
printf(FormattedText([
("#FFFFFF", "Set "),
("#FF00FF", x.macro_label),
("#FFFFFF", " to "),
("#FFFFFF", str(x.macro_expr))
]))
if isinstance(x, runner.CommandStatus):
printf(x.formatted_text)