Browse Source

Better pretty-printing

David Peter 2 years ago
parent
commit
4b0f023637
2 changed files with 4 additions and 3 deletions
  1. 1 1
      numbat-cli/src/ansi_formatter.rs
  2. 3 2
      numbat-cli/src/main.rs

+ 1 - 1
numbat-cli/src/ansi_formatter.rs

@@ -17,7 +17,7 @@ impl Formatter for ANSIFormatter {
             FormatType::Identifier => text.normal(),
             FormatType::TypeIdentifier => text.bright_yellow(),
             FormatType::Operator => text.bold(),
-            FormatType::Decorator => text.yellow(),
+            FormatType::Decorator => text.green(),
         })
         .to_string()
     }

+ 3 - 2
numbat-cli/src/main.rs

@@ -209,13 +209,14 @@ impl Cli {
                     for statement in &statements {
                         let repr = ANSIFormatter {}.format(&statement.pretty_print(), true);
                         println!("{}", repr);
+                        println!();
                     }
+                } else {
+                    println!();
                 }
 
                 match interpreter_result {
                     InterpreterResult::Quantity(quantity) => {
-                        println!();
-
                         let q_markup = markup::whitespace("    ")
                             + markup::operator("=")
                             + markup::space()