diff --git a/markup_fmt/src/error.rs b/markup_fmt/src/error.rs index 15e13cb..f3218df 100644 --- a/markup_fmt/src/error.rs +++ b/markup_fmt/src/error.rs @@ -51,45 +51,45 @@ pub enum SyntaxErrorKind { impl fmt::Display for SyntaxError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let reason: Cow<_> = match self.kind { - SyntaxErrorKind::ExpectAngularFor => "expect Angular `@for`".into(), - SyntaxErrorKind::ExpectAngularIf => "expect Angular `@if`".into(), - SyntaxErrorKind::ExpectAngularLet => "expect Angular `@let`".into(), - SyntaxErrorKind::ExpectAngularSwitch => "expect Angular `@switch`".into(), - SyntaxErrorKind::ExpectAstroAttr => "expect Astro attribute".into(), - SyntaxErrorKind::ExpectAstroExpr => "expect Astro expression".into(), - SyntaxErrorKind::ExpectAttrName => "expect attribute name".into(), - SyntaxErrorKind::ExpectAttrValue => "expect attribute value".into(), - SyntaxErrorKind::ExpectChar(c) => format!("expect char '{c}'").into(), - SyntaxErrorKind::ExpectCloseTag => "expect close tag".into(), - SyntaxErrorKind::ExpectComment => "expect comment".into(), - SyntaxErrorKind::ExpectDoctype => "expect HTML doctype".into(), - SyntaxErrorKind::ExpectElement => "expect element".into(), - SyntaxErrorKind::ExpectFrontMatter => "expect front matter".into(), - SyntaxErrorKind::ExpectIdentifier => "expect identifier".into(), - SyntaxErrorKind::ExpectJinjaBlockEnd => "expect Jinja block end".into(), - SyntaxErrorKind::ExpectJinjaTag => "expect Jinja tag".into(), + SyntaxErrorKind::ExpectAngularFor => "expected Angular `@for`".into(), + SyntaxErrorKind::ExpectAngularIf => "expected Angular `@if`".into(), + SyntaxErrorKind::ExpectAngularLet => "expected Angular `@let`".into(), + SyntaxErrorKind::ExpectAngularSwitch => "expected Angular `@switch`".into(), + SyntaxErrorKind::ExpectAstroAttr => "expected Astro attribute".into(), + SyntaxErrorKind::ExpectAstroExpr => "expected Astro expression".into(), + SyntaxErrorKind::ExpectAttrName => "expected attribute name".into(), + SyntaxErrorKind::ExpectAttrValue => "expected attribute value".into(), + SyntaxErrorKind::ExpectChar(c) => format!("expected char '{c}'").into(), + SyntaxErrorKind::ExpectCloseTag => "expected close tag".into(), + SyntaxErrorKind::ExpectComment => "expected comment".into(), + SyntaxErrorKind::ExpectDoctype => "expected HTML doctype".into(), + SyntaxErrorKind::ExpectElement => "expected element".into(), + SyntaxErrorKind::ExpectFrontMatter => "expected front matter".into(), + SyntaxErrorKind::ExpectIdentifier => "expected identifier".into(), + SyntaxErrorKind::ExpectJinjaBlockEnd => "expected Jinja block end".into(), + SyntaxErrorKind::ExpectJinjaTag => "expected Jinja tag".into(), SyntaxErrorKind::ExpectKeyword(keyword) => { - format!("expect keyword '{}'", keyword).into() + format!("expected keyword '{}'", keyword).into() } SyntaxErrorKind::ExpectMustacheInterpolation => { - "expect mustache-like interpolation".into() + "expected mustache-like interpolation".into() } - SyntaxErrorKind::ExpectSelfCloseTag => "expect self close tag".into(), - SyntaxErrorKind::ExpectSvelteAtTag => "expect Svelte `{@` tag".into(), - SyntaxErrorKind::ExpectSvelteAttr => "expect Svelte attribute".into(), - SyntaxErrorKind::ExpectSvelteAwaitBlock => "expect Svelte await block".into(), - SyntaxErrorKind::ExpectSvelteBlockEnd => "expect end of Svelte block".into(), - SyntaxErrorKind::ExpectSvelteCatchBlock => "expect Svelte catch block".into(), - SyntaxErrorKind::ExpectSvelteEachBlock => "expect Svelte each block".into(), - SyntaxErrorKind::ExpectSvelteElseIfBlock => "expect Svelte else if block".into(), - SyntaxErrorKind::ExpectSvelteIfBlock => "expect Svelte if block".into(), - SyntaxErrorKind::ExpectSvelteInterpolation => "expect Svelte interpolation".into(), - SyntaxErrorKind::ExpectSvelteKeyBlock => "expect Svelte key block".into(), - SyntaxErrorKind::ExpectSvelteThenBlock => "expect Svelte then block".into(), - SyntaxErrorKind::ExpectTagName => "expect tag name".into(), - SyntaxErrorKind::ExpectTextNode => "expect text node".into(), - SyntaxErrorKind::ExpectVentoBlockEnd => "expect Vento block end".into(), - SyntaxErrorKind::ExpectVueDirective => "expect Vue directive".into(), + SyntaxErrorKind::ExpectSelfCloseTag => "expected self close tag".into(), + SyntaxErrorKind::ExpectSvelteAtTag => "expected Svelte `{@` tag".into(), + SyntaxErrorKind::ExpectSvelteAttr => "expected Svelte attribute".into(), + SyntaxErrorKind::ExpectSvelteAwaitBlock => "expected Svelte await block".into(), + SyntaxErrorKind::ExpectSvelteBlockEnd => "expected end of Svelte block".into(), + SyntaxErrorKind::ExpectSvelteCatchBlock => "expected Svelte catch block".into(), + SyntaxErrorKind::ExpectSvelteEachBlock => "expected Svelte each block".into(), + SyntaxErrorKind::ExpectSvelteElseIfBlock => "expected Svelte else if block".into(), + SyntaxErrorKind::ExpectSvelteIfBlock => "expected Svelte if block".into(), + SyntaxErrorKind::ExpectSvelteInterpolation => "expected Svelte interpolation".into(), + SyntaxErrorKind::ExpectSvelteKeyBlock => "expected Svelte key block".into(), + SyntaxErrorKind::ExpectSvelteThenBlock => "expected Svelte then block".into(), + SyntaxErrorKind::ExpectTagName => "expected tag name".into(), + SyntaxErrorKind::ExpectTextNode => "expected text node".into(), + SyntaxErrorKind::ExpectVentoBlockEnd => "expected Vento block end".into(), + SyntaxErrorKind::ExpectVueDirective => "expected Vue directive".into(), }; write!(