netform_ir 0.5.0

Lossless intermediate representation and parser for network configuration text
Documentation

Lossless intermediate representation (IR) for network device configuration text.

This crate provides:

  • a tree model (Document, Node, LineNode, BlockNode)
  • a conservative parser (parse_generic, parse_with_dialect)
  • a lossless renderer (Document::render)

The parser is intentionally conservative for pre-alpha use:

  • it only uses indentation as a structural cue
  • unknown patterns are preserved as regular lines
  • no input lines are dropped

Example

use netform_ir::parse_generic;

let input = "interface Ethernet1\n  description uplink\n";
let doc = parse_generic(input);
assert_eq!(doc.render(), input);