Skip to main content

Crate oak_rst

Crate oak_rst 

Source
Expand description

§oak-rst

High-performance incremental reStructuredText parser for the oak ecosystem.

§Features

  • Incremental parsing of reStructuredText documents
  • Support for directives, substitutions, roles, footnotes, and citations
  • Extensible architecture for custom reStructuredText extensions
  • Integration with the oak ecosystem for language services

§Usage

use oak_rst::{RstLexer, RstParser, RstLanguage};
use oak_core::{ParseSession, SourceText, Parser};

let code = "# Heading\n\nParagraph with *emphasis* and **strong** text.";
let language = RstLanguage::default();
let lexer = RstLexer::new(&language);
let parser = RstParser::new(&language);

// Parse the code
let source = SourceText::new(code);
let mut session = ParseSession::new(16);
let result = parser.parse(&source, &[], &mut session);

§Features Flags

  • serde: Enables serialization/deserialization support
  • lsp: Enables Language Server Protocol support
  • mcp: Enables Multi-Compiler Protocol support

§License

This project is licensed under the MIT License - see the LICENSE file for details.

Re-exports§

pub use crate::ast::RstRoot;
pub use crate::language::RstLanguage;
pub use crate::lexer::RstLexer;
pub use crate::parser::RstParser;

Modules§

ast
Abstract Syntax Tree for reStructuredText.
language
The reStructuredText language implementation for Oaks.
lexer
Lexer for tokenizing reStructuredText source.
parser
Parser for building reStructuredText syntax trees.