planus_lexer/
lib.rs

1//! Library for lexing flatbuffer files.
2//!
3//! This library is an internal implementation
4//! detail of [planus-cli](https://docs.rs/planus-cli).
5//!
6//! Feel free to use it, however there are no stability guarantees.
7
8mod error;
9mod full_lexer;
10mod raw_lexer;
11mod text_lexer;
12
13use codespan::ByteIndex;
14pub use error::LexicalError;
15pub use full_lexer::{Comment, CommentBlock, TokenMetadata, TokenWithMetadata};
16pub use raw_lexer::{CommentKind, Keyword, Symbol, Token};
17
18pub fn lexer(
19    s: &str,
20) -> impl Iterator<Item = Result<(ByteIndex, TokenWithMetadata<'_>, ByteIndex), LexicalError>> {
21    full_lexer::Lexer::new(s)
22}