utterance 0.1.0

A parser library for creating readable, natural-language-inspired domain-specific languages.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use thiserror::Error;

#[derive(Debug, Error, Clone, Eq, PartialEq)]
pub enum LexError {
    #[error("unexpected character '{character}' at position {position}")]
    UnexpectedCharacter { position: usize, character: char },

    #[error(
        "non-ASCII symbol '{character}' at position {position} must not be preceded by whitespace"
    )]
    NonAsciiPrecededByWhitespace { position: usize, character: char },

    #[error("non-ASCII symbol '{character}' at position {position} must be followed by whitespace")]
    NonAsciiNotFollowedByWhitespace { position: usize, character: char },
}