Adds some q&d line identifiers
This commit is contained in:
parent
9ee72e03b3
commit
8b110c9d6d
|
|
@ -125,23 +125,69 @@ async fn launch_subprocess(args: &MakeConfig) -> Result<Status> {
|
|||
}
|
||||
|
||||
/// The line encountered
|
||||
// #[allow(unused)]
|
||||
#[derive(Debug)]
|
||||
enum LineType {
|
||||
/// The tex building mode
|
||||
Mode,
|
||||
/// Info level
|
||||
Info,
|
||||
/// TabularArray
|
||||
//TODO: Change to size and not full line ?
|
||||
TabularWarn(String),
|
||||
/// Warning level
|
||||
Warning(String),
|
||||
/// PdfTex Version
|
||||
PdfTexVersion(String),
|
||||
/// Context, mosty for boxes
|
||||
Context(String),
|
||||
/// Overfull and underfull boxes
|
||||
BoxFullness,
|
||||
/// Unknown type
|
||||
Unknown(String),
|
||||
/// Empty line, to discard
|
||||
Empty,
|
||||
/// The Latex Version
|
||||
LaTexVersion(String),
|
||||
/// The write18 mode, whatever that is
|
||||
WriteMode(String),
|
||||
/// The class of document (book, article, etc)
|
||||
DocumentClass(String),
|
||||
/// Signals that the parser entered a document
|
||||
EnteringDocument(String),
|
||||
/// Info on the loading of a library
|
||||
Library(String),
|
||||
/// Loading (Load something)
|
||||
Loading(String),
|
||||
}
|
||||
|
||||
/// Check each line and changes the status and/or display according warnings
|
||||
fn checkline(s: &str, status: &mut Status, context: &mut Vec<String>) -> Result<()> {
|
||||
// Match the line to guess what is happening
|
||||
let line = match s {
|
||||
s if s.starts_with("entering_extended_mode") => LineType::Mode,
|
||||
s if s.starts_with("entering extended mode") => LineType::Mode,
|
||||
s if s.starts_with("This is pdfTeX") => LineType::PdfTexVersion(s.to_string()),
|
||||
s if s.starts_with("LaTeX2e") => LineType::LaTexVersion(s.to_string()),
|
||||
s if s.starts_with("Package tabularray Warning") => LineType::TabularWarn(s.to_string()),
|
||||
s if s.starts_with("Overfull") => LineType::BoxFullness,
|
||||
s if s.starts_with("Underfull") => LineType::BoxFullness,
|
||||
s if s.starts_with("L3 programming layer") => LineType::Info,
|
||||
s if s.starts_with(" restricted \\write18 enabled.") => LineType::Context(s.to_string()),
|
||||
s if s.starts_with(" [") => LineType::WriteMode(s.to_string()),
|
||||
s if s.starts_with("Document Class") => LineType::DocumentClass(s.to_string()),
|
||||
s if s.starts_with("Library") => LineType::Library(s.to_string()),
|
||||
s if s.starts_with("(./") => LineType::EnteringDocument(s.to_string()),
|
||||
s if s.starts_with("(/usr/share/texlive/") => LineType::Loading(s.to_string()),
|
||||
// "LaTeX Warning: Reference"
|
||||
"" => LineType::Empty,
|
||||
_ => LineType::Unknown(s.to_string()),
|
||||
};
|
||||
// status.warnings += 1;
|
||||
println!("{:?}", line);
|
||||
match line {
|
||||
LineType::Warning(w) => println!("{}", w),
|
||||
LineType::Unknown(w) => println!("Unknown: {}", w),
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue