laburnum 1.17.1

An LSP framework for building language servers and compilers, powered by an incremental query tree with content-addressed storage, task-based dataflow, and parallel queries.
Documentation
// Copyright Two Neutron Stars Incorporated and contributors
// SPDX-License-Identifier: BlueOak-1.0.0

//! Generic lexer infrastructure for chumsky-based parsers.
//!
//! This module provides reusable components for building lexers:
//!
//! - [`Trivia`] - Whitespace and formatting representation
//! - [`define_tokens!`] - Macro to generate token enums and lexers
//! - [`wrap!`] - Macro to wrap token parsers with trivia handling
//!
//! # Example
//!
//! ```ignore
//! use laburnum::chumsky::lexer::{define_tokens, Trivia};
//!
//! // Define your Token enum that wraps generated types
//! pub enum Token {
//!     Keyword(Option<Trivia>, laburnum::Spanned<Keyword>, Option<Trivia>),
//!     // ...
//! }
//!
//! // Generate the Keyword enum and lexer
//! define_tokens! {
//!     #[keyword]
//!     Token::Keyword(Keyword -> [
//!         "fn" => Fn,
//!         "let" => Let,
//!         "if" => If,
//!     ])
//! }
//! ```

mod define_tokens;
pub mod trivia;

pub use define_tokens::define_tokens;
pub use trivia::{Trivia, leading, newline, newlines, print_trivia_bluegum, space, tab, trailing, wrap};