Skip to main content

oak_tex/
lib.rs

1#![doc = include_str!("readme.md")]
2#![feature(new_range_api)]
3#![warn(missing_docs)]
4#![doc(html_logo_url = "https://raw.githubusercontent.com/ygg-lang/oaks/refs/heads/dev/documents/logo.svg")]
5#![doc(html_favicon_url = "https://raw.githubusercontent.com/ygg-lang/oaks/refs/heads/dev/documents/logo.svg")]
6//! TeX support for the Oak language framework.
7//!
8//! This crate provides lexing, parsing, and AST building for TeX/LaTeX documents,
9//! enabling integration with the Oak language server and other tools.
10
11/// AST module containing TeX syntax tree definitions.
12pub mod ast;
13/// Builder module for constructing TeX ASTs.
14pub mod builder;
15
16/// Language definition and configuration for TeX.
17pub mod language;
18/// Lexer implementation for TeX.
19pub mod lexer;
20/// LSP-related functionality (hover, completion, highlighting) for TeX.
21#[cfg(any(feature = "lsp", feature = "oak-highlight", feature = "oak-pretty-print"))]
22pub mod lsp;
23/// MCP (Model Context Protocol) integration for TeX.
24#[cfg(feature = "mcp")]
25pub mod mcp;
26
27/// Parser implementation for TeX.
28pub mod parser;
29
30pub use crate::{ast::TexRoot, builder::TexBuilder, language::TexLanguage, lexer::TexLexer, parser::TexParser};
31
32/// Highlighter implementation.
33#[cfg(feature = "oak-highlight")]
34pub use crate::lsp::highlighter::TexHighlighter;
35
36#[cfg(feature = "lsp")]
37pub use crate::lsp::TexLanguageService;
38/// LSP implementation.
39#[cfg(feature = "lsp")]
40pub use crate::lsp::formatter::TexFormatter;
41
42/// MCP service implementation.
43#[cfg(feature = "mcp")]
44pub use crate::mcp::serve_tex_mcp;
45pub use lexer::token_type::TexTokenType;
46pub use parser::element_type::TexElementType;