Skip to main content

Module reverse

Module reverse 

Source
Expand description

Reverse conversion of a grammar back to its source format.

The checked cycle is source grammar -> native links -> exported grammar -> native links: the source is imported, written as the native links form and read back from those links alone, so the emitter is handed a grammar decoded from links and never the source text. The export is re-imported and compared with the imported grammar rule by rule (names, start rule, kinds, definitions modulo the documented canonical spelling of single-character sets, and rule documentation, the provenance an importer keeps from comments), and both grammars are run on independent accept and reject samples. It mirrors js/src/grammar-reverse.js.

Structs§

GrammarReverseConversion
The importer/emitter pair under test and the independent samples.
GrammarReverseFailure
One failed check.
GrammarReverseReport
The outcome of check_grammar_reverse_conversion.

Enums§

GrammarReverseFailureKind
What a failed check found.
GrammarReverseStage
The step of the cycle a failed check looked at.
GrammarReverseStatus
Whether the cycle kept the grammar.

Functions§

check_grammar_reverse_conversion
Runs the reverse conversion cycle on source and reports every failure.