compactp_parser 0.1.0-beta.1

Recursive-descent parser for the Compact language producing a lossless CST and structured diagnostics.
Documentation

compactp_parser

Recursive-descent parser for the Compact language (Midnight Network), the core of the compactp parser frontend.

Produces a lossless concrete syntax tree (every byte recoverable) plus a list of structured diagnostics. Uses marker-based tree construction over rowan, Pratt-style expression precedence, and explicit error recovery with ERROR nodes. Bounded recursion depth (ParseOptions::max_depth, default 256) guarantees no stack overflow on adversarial input.

Example

use compactp_parser::parse;
use compactp_syntax::{SyntaxKind, SyntaxNode};

let result = parse("");
let root = SyntaxNode::new_root(result.green);
assert_eq!(root.kind(), SyntaxKind::SOURCE_FILE);
assert!(result.errors.is_empty());

Status

Beta (0.x). APIs may change between minor versions. See the compatibility matrix.

License

MIT