Skip to main content

Crate oak_stylus

Crate oak_stylus 

Source
Expand description

§Oak Stylus

Stylus language support for the Oak framework.

§Features

  • Lexical analysis for Stylus syntax
  • Syntax parsing for Stylus constructs
  • Abstract syntax tree (AST) representation
  • Integration with Oak core framework

§Usage

use oak_stylus::{StylusLanguage, StylusLexer, StylusParser, StylusBuilder};
use oak_core::{Lexer, Parser, Builder, Source, SourceText};

// Create a source text
let source = Source::new(SourceText::from("body { color: red; }".to_string()));

// Lex the source
let lexer = StylusLexer;
let lex_output = lexer.lex(source.text());

// Parse the tokens
let parser = StylusParser;
let parse_output = parser.parse(&mut lex_output.into_session());

// Build the syntax tree
let builder = StylusBuilder;
let green_tree = builder.build(&mut Default::default(), &Default::default());

§Implementation Status

  • Language trait implementation
  • Token types and roles
  • Element types and roles
  • Lexer implementation (basic)
  • Parser implementation (basic)
  • AST structure
  • Builder implementation (basic)
  • Full lexer implementation
  • Full parser implementation
  • LSP support
  • MCP support

§Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

Re-exports§

pub use crate::ast::StylusRoot;
pub use crate::builder::StylusBuilder;
pub use crate::language::StylusLanguage;
pub use crate::lexer::StylusLexer;
pub use crate::lexer::token_type::StylusTokenType;
pub use crate::parser::StylusParser;

Modules§

ast
AST module.
builder
Builder module.
language
Language configuration module.
lexer
Lexer module.
parser
Parser module.