Skip to content

Commit

Permalink
document ParseError
Browse files Browse the repository at this point in the history
  • Loading branch information
phenylshima committed Jan 24, 2024
1 parent f0645f6 commit 86bd580
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/jlabel/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ use crate::fullcontext_label::{
Mora, Phoneme, Utterance, Word,
};

/// Errors from jlabel parser.
#[derive(Debug, thiserror::Error)]
pub enum ParseError {
/// The required symbol was not found.
#[error("Symbol not found: expected {0}")]
SymbolNotFound(&'static str),
/// The position was supposed to be integer, but failed to parse it as integer.
#[error("Parse int error: {0}")]
ParseIntError(#[from] ParseIntError),
/// The position was supposed to be boolean (0 or 1), but failed to parse it as boolean.
#[error("Parse bool error")]
ParseBoolError,
/// The position must always be undefined.
#[error("Not undefined")]
NotUndefined,
}
Expand Down

0 comments on commit 86bd580

Please sign in to comment.