Make sure that what is printed in the smtml format is parseable #432
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to make reproducing errors/bugs/issues easier, it is related to OCamlPro/owi#631, and the idea is to make sure that when we print smtml queries (in its AST) we can parse back the same thing and rerun it through smtml. It is currently not the case.
This PR:
Formats withFmtsExpr.pp_smttoExpr.pp_smtml(since it prints in the smtml format not smt, the name is now less ambiguous and the doc is updated)to-smtmlwhich simply usesExpr.pp_smtmlto print the parsed/typed content of a.smtmlfile, I only added this command for testing purposes, I don't think it would be useful for something else (other than potentially formatting but the current output is not particularly well formatted anyway) so I can remove it if you want me to.Can be tested with
dune exec -- smtml to-smtml test/cli/smtml/test_lia.smtml > out.smtmland then running smtml onout.smtml, which works with bbd38bf and 85121a3 and doesn't without them.