Fix some formatting issues, mostly around comments and whitespace.
This commit is contained in:
@@ -10,7 +10,7 @@ use pretty::termcolor::{ColorChoice, StandardStream};
|
||||
use target_lexicon::Triple;
|
||||
|
||||
/// A high-level compiler for NGR programs.
|
||||
///
|
||||
///
|
||||
/// This object can be built once, and then re-used many times to build multiple
|
||||
/// files. For most users, the [`Default`] implementation should be sufficient;
|
||||
/// it will use `stderr` for warnings and errors, with default colors based on
|
||||
@@ -62,17 +62,17 @@ impl Compiler {
|
||||
|
||||
/// This is the actual meat of the compilation chain; we hide it from the user
|
||||
/// because the type is kind of unpleasant.
|
||||
///
|
||||
///
|
||||
/// The weird error type comes from the fact that we can run into three types
|
||||
/// of result:
|
||||
///
|
||||
///
|
||||
/// * Fundamental errors, like an incorrectly formatted file or some
|
||||
/// oddity with IO. These return `Err`.
|
||||
/// * Validation errors, where we reject the program due to something
|
||||
/// semantically wrong with them. These return `Ok(None)`.
|
||||
/// * Success! In this case, we return `Ok(Some(...))`, where the bytes
|
||||
/// returned is the contents of the compiled object file.
|
||||
///
|
||||
///
|
||||
fn compile_internal(&mut self, input_file: &str) -> Result<Option<Vec<u8>>, CompilerError> {
|
||||
// Try to parse the file into our syntax AST. If we fail, emit the error
|
||||
// and then immediately return `None`.
|
||||
@@ -111,7 +111,7 @@ impl Compiler {
|
||||
}
|
||||
|
||||
/// Emit a diagnostic.
|
||||
///
|
||||
///
|
||||
/// This is just a really handy shorthand we use elsewhere in the object, because
|
||||
/// there's a lot of boilerplate we'd like to skip.
|
||||
fn emit(&mut self, diagnostic: Diagnostic<usize>) {
|
||||
|
||||
Reference in New Issue
Block a user