Require documentation on reader public items.
This commit is contained in:
@@ -8,13 +8,16 @@ use std::result;
|
||||
/// The location of a `Token` or `Error`.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub struct Location {
|
||||
/// Line number, starting from 1.
|
||||
pub line_number: usize,
|
||||
}
|
||||
|
||||
/// A parse error is returned when the parse failed.
|
||||
#[derive(Debug)]
|
||||
pub struct Error {
|
||||
/// Location of the error.
|
||||
pub location: Location,
|
||||
/// Error message.
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
@@ -24,6 +27,7 @@ impl fmt::Display for Error {
|
||||
}
|
||||
}
|
||||
|
||||
/// Result of a parser operation. The `Error` variant includes a location.
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
// Create an `Err` variant of `Result<X>` from a location and `format!` args.
|
||||
|
||||
Reference in New Issue
Block a user