Expand description
Mutation-guarded grammar interchange round trips.
A plain round trip (import, emit, re-import, compare) cannot tell a correct
importer/emitter pair from two that are wrong in mutually cancelling ways,
and it cannot tell an emitter that re-emits a cached source from one that
prints the grammar it was given. The guard therefore changes the grammar
before export, requires the change in the exported text and in the
re-imported grammar, and checks both the imported and the re-imported
grammar against independent accept and reject samples that do not come
from the pair under test. It mirrors js/src/grammar-round-trip.js.
Structs§
- Grammar
Round Trip - The importer/emitter pair under test and the independent samples.
- Grammar
Round Trip Failure - One failed check.
- Grammar
Round Trip Report - The outcome of
check_grammar_round_trip.
Enums§
- Grammar
Round Trip Error - Why the guard could not run.
- Grammar
Round Trip Failure Kind - What a failed check found.
- Grammar
Round Trip Stage - The grammar a failed check looked at.
- Grammar
Round Trip Status - Whether the pair carried the grammar and the mutation.
Constants§
- GRAMMAR_
ROUND_ TRIP_ MARKER - The literal alternative the guard adds to the start rule by default.
Functions§
- accepts_
text - Whether
textparses withgrammaron the native executor, as the JavaScriptacceptsTextdoes. - canonical_
rule_ definition - The meaning-aware definition of a rule.
- check_
grammar_ round_ trip - Round trips
sourcethrough a mutated export and reports every failure. - mutate_
grammar_ start_ rule - Adds
markeras a literal alternative of the start rule.
Type Aliases§
- Grammar
Emit Fn - Emits a grammar in one notation, with its fidelity report.
- Grammar
Import Fn - Imports grammar source text of one notation.