mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 18:08:55 +03:00
A fast, friendly, functional language. Work in progress!
a046428ce6
This commit adds fuzzing for the (expr) formatter, with the same invariants that we use for fmt tests: * We start with text, which we parse * We format the AST, which must succeed * We parse back the AST and make sure it's identical igoring whitespace+comments * We format the new AST and assert it's equal to the first formatted version ("idempotency") Interestingly, while a lot of bugs this found were in the formatter, it also found some parsing bugs. It then fixes a bunch of bugs that fell out: * Some small oversights in RemoveSpaces * Make sure `_a` doesn't parse as an inferred type (`_`) followed by an identifier (parsing bug!) * Call `extract_spaces` on a parsed expr before matching on it, lest it be Expr::SpaceBefore - when parsing aliases * A few cases where the formatter generated invalid/different code * Numerous formatting bugs that caused the formatting to not be idempotent The last point there is worth talking further about. There were several cases where the old code was trying to enforce strong opinions about how to insert newlines in function types and defs. In both of those cases, it looked like the goals of (1) idempotency, (2) giving the user some say in the output, and (3) these strong opinions - were often in conflict. For these cases, I erred on the side of following the user's existing choices about where to put newlines. We can go back and re-add this strong opinionation later - but this seemed the right approach for now. |
||
---|---|---|
.cargo | ||
.github | ||
.reuse | ||
ci | ||
crates | ||
design | ||
devtools | ||
examples | ||
getting_started | ||
nightly_benches | ||
www | ||
.gitignore | ||
.llvmenv | ||
AUTHORS | ||
BUILDING_FROM_SOURCE.md | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
default.nix | ||
FAQ.md | ||
flake.lock | ||
flake.nix | ||
LEGAL_DETAILS | ||
LICENSE | ||
mlc_config.json | ||
README.md | ||
roc-for-elm-programmers.md | ||
rust-toolchain.toml | ||
shell.nix | ||
typos.toml | ||
version.txt |
Work in progress!
Roc is not ready for a 0.1 release yet, but we do have:
- installation guide
- tutorial
- docs for the standard library
- frequently asked questions
- Zulip chat for help, questions and discussions
If you'd like to get involved in contributing to the language, the Zulip chat is also the best place to get help with good first issues.
Sponsors
We are very grateful to our sponsors NoRedInk, rwx, and Tweede golf.
If you or your employer would like to sponsor Roc's development, please DM Richard Feldman on Zulip!