Skip to main content

LexError

Type Alias LexError 

Source
pub type LexError = SyntaxError;
Expand description

Lexical errors share the syntax error type: the engine reports both as SyntaxError.

Aliased Type§

pub struct LexError {
    pub message: String,
    pub span: Span,
}

Fields§

§message: String

Human readable message (no position prefix).

§span: Span

Where the error happened.

Implementations§

Source§

impl LexError

Source

pub fn new(message: impl Into<String>, span: Span) -> LexError

Build an error at span.

Source

pub fn line(&self) -> u32

1-based line of the error.

Source

pub fn column(&self) -> u32

1-based column of the error.