mirror of
https://github.com/swarm-game/swarm.git
synced 2024-09-11 14:46:33 +03:00
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. |
||
---|---|---|
.. | ||
Main.hs | ||
TestBoolExpr.hs | ||
TestCommand.hs | ||
TestEval.hs | ||
TestInventory.hs | ||
TestLanguagePipeline.hs | ||
TestLSP.hs | ||
TestNotification.hs | ||
TestOrdering.hs | ||
TestParse.hs | ||
TestPedagogy.hs | ||
TestPretty.hs | ||
TestRecipeCoverage.hs | ||
TestRepl.hs | ||
TestScoring.hs | ||
TestUtil.hs |