Expand description
Universal lossless CST infrastructure for issue #138.
This module mirrors js/src/cst.mjs: three node kinds (list, token,
trivia), a content-agnostic round-trip printer, and .lino
serialisation/deserialisation helpers. Used by cst_rust, cst_js,
cst_lean and cst_rocq to express their token streams.
Modules§
- dialects
- The four host-language dialect tag prefixes plus the shared dialect.
Enums§
- CstNode
- A CST node. Three kinds:
List(with optionalopen/closedelimiters),Token(significant lexeme),Trivia(whitespace or comment).
Functions§
- clone_
cst - Convenience: return a clone of
node. Provided for parity with the JS module which exportscloneCstexplicitly. - cst_
to_ lino - Serialise a CST node into a
.linoS-expression matching the format produced byjs/src/cst.mjs’scstToLino. - lino_
to_ cst - Parse the
.linoS-expression produced bycst_to_linoback into aCstNode. Inverse ofcst_to_lino. - print_
cst - Print a CST node back to its byte-faithful source form.