Colored repl command output
This commit is contained in:
parent
819a06503f
commit
ebda79e5fd
@ -1,7 +1,5 @@
|
|||||||
extern crate colored;
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use self::colored::*;
|
use colored::*;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
pub struct LLVMCodeString(pub String);
|
pub struct LLVMCodeString(pub String);
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate rustyline;
|
extern crate rustyline;
|
||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
|
extern crate colored;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
@ -22,6 +23,7 @@ use std::default::Default;
|
|||||||
|
|
||||||
use rustyline::error::ReadlineError;
|
use rustyline::error::ReadlineError;
|
||||||
use rustyline::Editor;
|
use rustyline::Editor;
|
||||||
|
use self::colored::*;
|
||||||
|
|
||||||
mod language;
|
mod language;
|
||||||
mod webapp;
|
mod webapp;
|
||||||
@ -228,6 +230,7 @@ impl Repl {
|
|||||||
println!("exit | quit");
|
println!("exit | quit");
|
||||||
println!("lang(uage) [go|show|next|previous]");
|
println!("lang(uage) [go|show|next|previous]");
|
||||||
println!("set [show|hide] [tokens|parse|symbols|eval|llvm]");
|
println!("set [show|hide] [tokens|parse|symbols|eval|llvm]");
|
||||||
|
println!("options");
|
||||||
}
|
}
|
||||||
"lang" | "language" => {
|
"lang" | "language" => {
|
||||||
match commands.get(1) {
|
match commands.get(1) {
|
||||||
@ -297,6 +300,15 @@ impl Repl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"options" => {
|
||||||
|
let ref d = self.options.debug;
|
||||||
|
let tokens = if d.tokens { "true".green() } else { "false".red() };
|
||||||
|
let parse_tree = if d.parse_tree { "true".green() } else { "false".red() };
|
||||||
|
let ast = if d.ast { "true".green() } else { "false".red() };
|
||||||
|
let symbol_table = if d.symbol_table { "true".green() } else { "false".red() };
|
||||||
|
println!(r#"Debug:
|
||||||
|
tokens: {}, parse: {}, ast: {}, symbols: {}"#, tokens, parse_tree, ast, symbol_table);
|
||||||
|
},
|
||||||
e => println!("Unknown command: {}", e)
|
e => println!("Unknown command: {}", e)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user