Enum SyntaxError

Source
pub enum SyntaxError {
Show 42 variants ExpectedIdentifier(String), ExpectedPath(String), BlockName(String), LiteralNewline(String), PartialPosition(String), SubExprNotOpen(String), SubExprTargetNotAllowed(String), PathDelimiterNotAllowed(String), ElseNotAllowed(String), UnexpectedPathExplicitThis(String), UnexpectedPathParent(String), UnexpectedPathLocal(String), UnexpectedPathDelimiter(String), UnexpectedPathParentWithLocal(String), UnexpectedPathParentWithExplicit(String), ExpectedPathDelimiter(String), OpenSubExpression(String), TagNameMismatch(String), BlockNotOpen(String), SubExpressionNotTerminated(String), LinkNotTerminated(String), RawBlockOpenNotTerminated(String), RawBlockNotTerminated(String), RawCommentNotTerminated(String), RawStatementNotTerminated(String), CommentNotTerminated(String), BlockTargetSubExpr(String), EmptyPath(String), ComponentType(String), MixedPartialConditional(String), TokenError(String, String), TokenCallTarget(String), TokenJsonLiteral(String), TokenParameter(String), TokenHashKeyValue(String), TokenRawLiteral(String), TokenDoubleQuoteLiteral(String), TokenSingleQuoteLiteral(String), TokenArrayLiteral(String), TokenLink(String), TokenParameterPath(String), TokenEndRawBlock(String),
}
Expand description

Errors generated when compiling a template.

Variants§

§

ExpectedIdentifier(String)

Error when an identifier is expected.

§

ExpectedPath(String)

Error when a path is expected.

§

BlockName(String)

Error if a block name is not a simple identifier.

§

LiteralNewline(String)

Error when a newline is enccountered in a raw literal.

§

PartialPosition(String)

Error when the partial operator is not the first token in a call statement.

§

SubExprNotOpen(String)

Error when a sub-expression is closed by no sub-expression is open.

§

SubExprTargetNotAllowed(String)

Error when a sub-expression attempts to use a sub-expression for it’s target.

Currently sub-expressions for the target are only supported when evaluating partials.

§

PathDelimiterNotAllowed(String)

Error when a path delimiter is encountered in an invalid position.

§

ElseNotAllowed(String)

Error when the else keyword is encountered in an invalid position.

§

UnexpectedPathExplicitThis(String)

Error when the this keywords is not at the start of a path.

§

UnexpectedPathParent(String)

Error when a parent path reference (../) is not at the start of a path.

§

UnexpectedPathLocal(String)

Error when a local identifier is not at the start of a path.

§

UnexpectedPathDelimiter(String)

Error when an identifier is expected but a path delimiter was encountered.

§

UnexpectedPathParentWithLocal(String)

Error when parent scope references and local identifiers are combined illegally.

§

UnexpectedPathParentWithExplicit(String)

Error attempting to mix parent scope references and explicit this.

§

ExpectedPathDelimiter(String)

Error when a path delimiter is expected.

§

OpenSubExpression(String)

Error when a sub-expression was not terminated.

§

TagNameMismatch(String)

Error when a closing tag name does not match the opening name.

§

BlockNotOpen(String)

Error when an end tag is encountered but no block is open.

§

SubExpressionNotTerminated(String)

Error when a sub-expression is not terminated.

§

LinkNotTerminated(String)

Erro when a link is not terminated.

§

RawBlockOpenNotTerminated(String)

Error when the opening tag for a raw block is not terminated.

§

RawBlockNotTerminated(String)

Error when a raw block is not terminated.

§

RawCommentNotTerminated(String)

Error when a raw comment is not terminated.

§

RawStatementNotTerminated(String)

Error when a raw statement is not terminated.

§

CommentNotTerminated(String)

Error when a comment is not terminated.

§

BlockTargetSubExpr(String)

Error attempting to use a sub-expression outside of a partial target context.

§

EmptyPath(String)

Error when an empty path is encountered.

§

ComponentType(String)

Error if we could not identify the type of a path component (internal error).

§

MixedPartialConditional(String)

Error attempting to combine partials with conditionals.

§

TokenError(String, String)

Invalid token error (internal error).

§

TokenCallTarget(String)

Invalid token error (internal error).

§

TokenJsonLiteral(String)

Invalid token error (internal error).

§

TokenParameter(String)

Invalid token error (internal error).

§

TokenHashKeyValue(String)

Invalid token error (internal error).

§

TokenRawLiteral(String)

Invalid token error (internal error).

§

TokenDoubleQuoteLiteral(String)

Invalid token error (internal error).

§

TokenSingleQuoteLiteral(String)

Invalid token error (internal error).

§

TokenArrayLiteral(String)

Invalid token error (internal error).

Invalid token error (internal error).

§

TokenParameterPath(String)

Invalid token error (internal error).

§

TokenEndRawBlock(String)

Invalid token error (internal error).

Trait Implementations§

Source§

impl Debug for SyntaxError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SyntaxError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SyntaxError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<SyntaxError> for Error

Source§

fn from(source: SyntaxError) -> Self

Converts to this type from the input type.
Source§

impl From<SyntaxError> for HelperError

Source§

fn from(source: SyntaxError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SyntaxError

Source§

fn eq(&self, other: &SyntaxError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SyntaxError

Source§

impl StructuralPartialEq for SyntaxError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.