swarm/test/unit
Brent Yorgey e071252d72
Add format --v0.5 option to port code from older syntax (#1851)
This is a followup on top of #1583 which turns `swarm format` into a tool for porting existing Swarm code into the newest syntax, via an extra `--v0.5` argument.  In particular, this PR:

- Generalizes the parser to take a configuration record, which among other things contains the language version being parsed.
- Adds code to allow the parser to parse either the current syntax or one version ago (when types did not start with capital letter) depending on the version in the configuration.
    - The idea is to have the parser always support the current version and one older version, so we can always upgrade version n to version n+1.
- Adds a new flag `--v0.5` to the `format` subcommand which causes the input to be parsed in v0.5 mode.  However, the output of `format` will always use the latest syntax.  Thus, `swarm format --v0.5` reads code in v0.5 format and prints it in the latest format, so this can be used to automatically port existing `.sw` files.

This PR also makes a few minor improvements to pretty-printing.
2024-05-22 00:09:31 +00:00
..
Main.hs Parse comments (#1838) 2024-05-12 00:32:21 +00:00
TestBoolExpr.hs prefer dots over dollars (#1190) 2023-04-02 20:24:03 +00:00
TestCommand.hs Parse comments (#1838) 2024-05-12 00:32:21 +00:00
TestEval.hs Require types to start with an uppercase letter (#1583) 2024-05-21 04:16:32 +00:00
TestInventory.hs Capability exercise cost (#1777) 2024-04-25 19:39:54 +00:00
TestLanguagePipeline.hs Add format --v0.5 option to port code from older syntax (#1851) 2024-05-22 00:09:31 +00:00
TestLSP.hs Add format --v0.5 option to port code from older syntax (#1851) 2024-05-22 00:09:31 +00:00
TestNotification.hs Improve separation of engine and scenario sublibraries (#1743) 2024-01-26 00:48:20 +00:00
TestOrdering.hs Structure browser and recognizer (#1579) 2023-11-08 06:44:27 +00:00
TestParse.hs Insert parsed comments back into the AST and pretty-print with comments (#1845) 2024-05-14 11:32:03 +00:00
TestPedagogy.hs Remove Benchmark dependence on AppState and TUI (#1746) 2024-01-26 17:56:39 +00:00
TestPretty.hs Require types to start with an uppercase letter (#1583) 2024-05-21 04:16:32 +00:00
TestRecipeCoverage.hs Capability exercise cost (#1777) 2024-04-25 19:39:54 +00:00
TestRepl.hs Require types to start with an uppercase letter (#1583) 2024-05-21 04:16:32 +00:00
TestScoring.hs split scenario construction into separate sublibrary (#1719) 2024-01-24 21:11:14 +00:00
TestUtil.hs extensible terrain (#1775) 2024-02-29 06:22:21 +00:00