Skip to main content

Crate neco_json5_ast

Crate neco_json5_ast 

Source
Expand description

§neco-json5-ast

日本語

necosystems series structured access layer for JSON5 values.

§Features

  • Owned Json5Document wrapping Json5Value for cross-crate trait use
  • Borrowed Json5Node<'a> carrying an optional field key
  • parse re-export that turns &str into Json5Document
  • StructuredDocument impl exposing mapping fields as top-level nodes
  • StructuredNode impl providing kind, identifier, attribute, children, and value

§Usage

use neco_ast::{StructuredDocument, StructuredNode};

let doc = neco_json5_ast::parse("name = neco\n").unwrap();
let node = doc.nodes().remove(0);
assert_eq!(node.kind(), "name");

§API

ItemDescription
parse(input: &str) -> Result<Json5Document, ParseError>Parses input via neco-json5 and wraps the value
Json5DocumentOwned wrapper around Json5Value
Json5Node<'a>Borrowed view with an optional field key
Json5Document::from_value / as_valueConstructs from or reads the inner Json5Value
Json5Node::from_value / as_valueConstructs a root view or reads the inner Json5Value
impl StructuredDocument for Json5Documentnodes() yields mapping fields, or the root value
impl StructuredNode for Json5Node<'_>Implements kind, identifier, attribute, children, and value

§License

MIT

Structs§

Json5Document
Json5Node

Functions§

parse