remove prints

This commit is contained in:
nora 2021-12-31 17:11:14 +01:00
parent 9ed7998401
commit f222e0cb10
3 changed files with 14 additions and 22 deletions

View file

@ -101,11 +101,11 @@ pub fn display_error(source: &str, error: CompilerError) {
if chars + line.len() > span.start {
let offset_on_line = span.start - chars;
println!("{}error: {}{}", RED, error.message, RESET);
println!(" {}|{}", CYAN, RESET);
println!("{}{:>5} |{} {}", CYAN, idx + 1, RESET, line);
print!(" {}|{} ", CYAN, RESET);
println!(
eprintln!("{}error: {}{}", RED, error.message, RESET);
eprintln!(" {}|{}", CYAN, RESET);
eprintln!("{}{:>5} |{} {}", CYAN, idx + 1, RESET, line);
eprint!(" {}|{} ", CYAN, RESET);
eprintln!(
"{}{}{}{}",
" ".repeat(offset_on_line),
RED,
@ -113,8 +113,8 @@ pub fn display_error(source: &str, error: CompilerError) {
RESET,
);
if let Some(note) = error.note {
println!(" {}|{}", CYAN, RESET);
println!(
eprintln!(" {}|{}", CYAN, RESET);
eprintln!(
" {}|{} {}note: {}{}",
CYAN, RESET, GREEN, note, RESET
);

View file

@ -46,7 +46,7 @@ pub fn run_program(program: &str) {
}
fn process_ast(program: &str, ast: Program, mut runtime: RtAlloc) {
println!("AST:\n{:?}\n", ast);
// println!("AST:\n{:?}\n", ast);
let bytecode_alloc = Bump::new();
@ -54,7 +54,7 @@ fn process_ast(program: &str, ast: Program, mut runtime: RtAlloc) {
match bytecode {
Ok(code) => {
println!("Bytecode:\n{:#?}\n", code);
// println!("Bytecode:\n{:#?}\n", code);
let result = vm::execute(&code, runtime);
if let Err(result) = result {

View file

@ -1,9 +1 @@
let x = 5;
print x + 4;
let test = x + 6 * 159353.004;
print test;
if x > test {
print "lmao";
}
print "hi brit";