Skip to main content

Module cst

Module cst 

Source
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 optional open/close delimiters), Token (significant lexeme), Trivia (whitespace or comment).

Functions§

clone_cst
Convenience: return a clone of node. Provided for parity with the JS module which exports cloneCst explicitly.
cst_to_lino
Serialise a CST node into a .lino S-expression matching the format produced by js/src/cst.mjs’s cstToLino.
lino_to_cst
Parse the .lino S-expression produced by cst_to_lino back into a CstNode. Inverse of cst_to_lino.
print_cst
Print a CST node back to its byte-faithful source form.