microsoft / Trieste

A term rewriting system for experimental programming language development.
MIT License
37 stars 20 forks source link

Adding the `Fuzzer`class, `NodeRange` -> `span`, and WF contexts. #114

Closed matajoh closed 3 months ago

matajoh commented 3 months ago

This commit adds a new Fuzzer class, which encapsulates the logic from Driver and allows it to be applied to the new Reader, Writer, and Rewriter classes. Another global change is the addition of a stack of wellformedness contexts. By calling wf::new_context and wf::end_context, it is possible to have nested Trieste pass ranges execute. This allows a Trieste pass to execute another Trieste pass as part of its execution (e.g. to parse a string using the JSON parser and the convert the resulting AST to a language-specific format). Finally, this commit changes NodeRange to be a std::span (NB an equivalent class is provided for C++17).

YAML

JSON

Misc

mjp41 commented 3 months ago

FYI, I didn't review the json/yaml/infix changes.