Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "not matching regex" conditional #2490

Merged
merged 9 commits into from
Dec 11, 2024
Prev Previous commit
Next Next commit
Reuse
laniakea64 committed Dec 11, 2024
commit a47118450d08cf2b2173a41404ca8bc8ed939c7d
12 changes: 1 addition & 11 deletions src/compile_error.rs
Original file line number Diff line number Diff line change
@@ -247,17 +247,7 @@ impl Display for CompileError<'_> {
),
UndefinedVariable { variable } => write!(f, "Variable `{variable}` not defined"),
UnexpectedCharacter { expected } => {
write!(f, "Expected character")?;
for (i, choice) in expected.iter().enumerate() {
if i > 0 && i == expected.len() - 1 {
write!(f, " or")?;
}
write!(f, " `{choice}`")?;
if expected.len() > 2 && i < expected.len() - 1 {
write!(f, ",")?;
}
}
Ok(())
write!(f, "Expected character {}", List::or_ticked(expected.iter()))
}
UnexpectedClosingDelimiter { close } => {
write!(f, "Unexpected closing delimiter `{}`", close.close())