pub fn print_error(chunk: &Chunk, i: usize, error: &str) {
    let point = chunk.get_point(i);
    let name = &chunk.name;
    let error_start = if name == "(main)" {
        format!("")
    } else {
        format!("{}:", name)
    };
    match point {
        Some((line, col)) => {
            eprintln!("{}{}:{}: {}", error_start, line, col, error);
        }
        _ => {
            eprintln!("{}{}", error_start, error);
        }
    }
}
/// Takes a chunk, an instruction index, and an error message as its
/// arguments.  Prints the error message, including filename, line number
/// and column number elements (if applicable).
Takes a chunk, an instruction index, and an error message as its
arguments.  Prints the error message, including filename, line number
and column number elements (if applicable).
Takes a chunk an instruction index and an error message as its arguments . Prints the error message including filename line number and column number elements ( if applicable ) .
pub fn print_error(chunk: &Chunk, i: usize, error: &str) {
    let point = chunk.get_point(i);
    let name = &chunk.name;
    let error_start = if name == "(main)" {
        format!("")
    } else {
        format!("{}:", name)
    };
    match point {
        Some((line, col)) => {
            eprintln!("{}{}:{}: {}", error_start, line, col, error);
        }
        _ => {
            eprintln!("{}{}", error_start, error);
        }
    }
}
pub fn print_error ( chunk : & Chunk , i : usize , error : & str ) { let point = chunk . get_point ( i ) ; let name = & chunk . name ; let error_start = if name == " " { format ! ( " " ) } else { format ! ( " " name ) } ; match point { Some ( ( line , col ) ) => { eprintln ! ( " " error_start line col error ) ; } _ => { eprintln ! ( " " error_start error ) ; } } }
Takes a chunk, an instruction index, and an error message as its
arguments.
Takes a chunk an instruction index and an error message as its arguments .
chunk
&Chunk
i
usize
error
&str