Skip to main content

Module document

Module document 

Source
Expand description

Public, fallible DOM layer over the internal panic-contract Ast.

Document is the single public, editable tree entry point. It wraps an internal crate::ast::Ast, exposes read access through NodeRef handles, and edits through fallible methods returning EditError – no panic from the Ast layer ever reaches a Document caller on user-input-driven paths.

§Structural validity vs semantic completeness

The wrapped Ast is always structurally valid. Whether the tree contains crate::ast::Node::Error placeholders is a separate, O(1) property exposed by Document::has_errors. A Document produced from a partial parse (containing Error nodes) is read-only.

Re-exports§

pub use crate::ast::NodeKind;

Structs§

Document
Public, fallible, editable DOM over an internal Ast.
DocumentId
Process-wide unique identity for a Document.
NodeId
Public node handle.
NodeRef
Read-only borrowed handle to a node within a Document.

Enums§

ArgRef
Read-side view of one command/environment argument value.
ArgValue
Write-side command/environment argument value.
DelimiterRef
DelimiterValue
Public write-side delimiter value.
EditError
Fallible editing error from Document mutation APIs.
FromSyntaxError
Error from Document::from_syntax.
GroupKindRef