//! Syntax tokenization and theme application. //! //! The crate keeps expensive work in the load/compile path. TextMate grammars //! compile into Oniguruma regex sets, JSON uses a dedicated lexer, scope names //! are interned, and the hot line APIs write into caller-owned buffers so //! editors and pagers can reuse allocations. #![allow(non_local_definitions)] #![warn(missing_docs)] #![warn(clippy::unwrap_used)] #![warn(rustdoc::missing_crate_level_docs)] #![warn(rustdoc::broken_intra_doc_links)] #![warn(rustdoc::bare_urls)] #![deny(unsafe_code)] // `serde` is the local alias for the `microserde` crate; the derive macro emits // `microserde::*` paths so the original crate name must remain in scope. extern crate serde as microserde; mod blob; mod error; mod grammar; mod raw; mod registry; mod theme; mod util; pub mod json; #[cfg(feature = "syntaxes")] pub mod syntaxes; pub use blob::{BlobCache, BlobHighlighter, LineBuffer, LineTokens, OwnedLineTokens, StyledLine}; pub use error::Error; pub use grammar::{Grammar, GrammarKind, LineState, LineTokenizer, ScopeId, ScopeSpan}; pub use raw::{RawCapture, RawGrammar, RawPattern, RawStyle, RawTheme, RawThemeRule}; pub use registry::{GrammarQuery, Registry}; pub use theme::{FontStyle, Rgb, Style, StyleSpan, Theme}; /// Maximum active include depth followed while matching recursive pattern sets. pub const MAX_INCLUDE_DEPTH: usize = 16; #[cfg(test)] #[allow(clippy::unwrap_used)] mod tests;