Skip to main content

Crate mycelium_hyphae

Crate mycelium_hyphae 

Source
Expand description

§mycelium-hyphae

Hyphae — the CSS-selector-inspired query language for Mycelium.

See RFC-0003 for the full grammar specification.

§Quick start

use mycelium_hyphae::parser::parse;
use mycelium_hyphae::ast::Ast;

let ast = parse("#login").unwrap();
if let Ast::SelectorList(selectors) = &ast {
    assert_eq!(selectors.len(), 1);
}

§Modules

  • ast — AST types produced by the parser.
  • lexer — token types and the tokenise function.
  • parser — entry point: the parse function.

Modules§

ast
Abstract Syntax Tree types for Hyphae queries.
evaluator
Hyphae Evaluator.
lexer
Lexer for the Hyphae query language.
parser
Recursive-descent parser for the Hyphae query language.

Functions§

parse
Parse a Hyphae query string into an ast::Ast.