Crate luther [−] [src]
A library for creating a lexer for a token type.
The motivating case for this crate is a token enum that has the Lexer
trait implemented on
it. The lexer
method of this trait will return a token iterator when given a char
iterator.
The Lexer
trait would normally be derived through the luther-derive crate.
The input to the lexer
method is a fallible iterator (i.e. an iterator with a Result item
type) over a Span
of char
. The output is a fallible iterator over a Span
of the token
type.
Modules
dfa |
Defines the |
spanned |
Defines iterators and other utilities for working with |
Structs
Location |
An abstract location within a stream of tokens or characters. |
Span |
Wraps a value with start and end |
Enums
LexError |
The error type for the lexers produced by Lexer implementations. |
Traits
Lexer |
An interface for creating a lexer for a |
Type Definitions
Result |
A specialized Result type for lexer operations. |