Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/math-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) enum LatexErrKind {
BoundFollowedByBound,
DuplicateSubOrSup,
SwitchOnlyInSequence,
ExpectedText(&'static str),
ExpectedText,
ExpectedLength(Box<str>),
ExpectedColSpec(Box<str>),
ExpectedNumber(Box<str>),
Expand Down Expand Up @@ -163,8 +163,8 @@ impl LatexErrKind {
LatexErrKind::SwitchOnlyInSequence => {
write!(s, "Math variant switch command found outside of sequence.")?;
}
LatexErrKind::ExpectedText(place) => {
write!(s, "Expected text in {place}.")?;
LatexErrKind::ExpectedText => {
write!(s, "Expected text in string literal.")?;
}
LatexErrKind::ExpectedLength(got) => {
write!(s, "Expected length with units, got \"{got}\".")?;
Expand Down Expand Up @@ -301,7 +301,7 @@ impl LatexError {
LatexErrKind::BoundFollowedByBound => "unexpected bound".into(),
LatexErrKind::DuplicateSubOrSup => "duplicate".into(),
LatexErrKind::SwitchOnlyInSequence => "math variant switch command as argument".into(),
LatexErrKind::ExpectedText(_) => "expected text here".into(),
LatexErrKind::ExpectedText => "expected text here".into(),
LatexErrKind::ExpectedLength(_) => "expected length here".into(),
LatexErrKind::ExpectedNumber(_) => "expected a number here".into(),
LatexErrKind::ExpectedColSpec(_) => "expected a column spec here".into(),
Expand Down
2 changes: 1 addition & 1 deletion crates/math-core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ where
let Some(ch) = recover_limited_ascii(tok) else {
return Err(Box::new(LatexError(
span.into(),
LatexErrKind::ExpectedText("string literal"),
LatexErrKind::ExpectedText,
)));
};
builder.push_char(ch);
Expand Down