Joshua Warner
a046428ce6
Add fuzzing for the formatter and fix bugs
...
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.
2022-12-17 09:52:09 -08:00
Richard Feldman
84eb82b815
Make fs_extra a workspace dependency
2022-12-01 22:33:04 -05:00
Richard Feldman
f5cb2d73a1
Merge branch 'precompiled-legacy' into https-packages
2022-11-24 04:29:56 -05:00
Richard Feldman
7d2fa63dca
Make roc_cache_dir() panic if it can't find $HOME
2022-11-20 20:54:03 -05:00
Richard Feldman
721841fa1f
Provide roc_cache_dir everywhere
2022-11-20 19:53:48 -05:00
Anton-4
d2959e95c2
improve/expand design docs
2022-11-19 18:27:09 +01:00
Richard Feldman
6486591201
Merge pull request #4462 from lukewilliamboswell/rust-docs
...
Rust docs update #2
2022-11-08 09:35:04 -08:00
Luke Boswell
2c2a70b8e7
Merge remote-tracking branch 'upstream/main' into rust-docs
2022-11-06 09:15:57 +11:00
Anton-4
590c61a6fd
Merge branch 'main' of github.com:roc-lang/roc into editor_launch_fix
2022-11-04 15:15:55 +01:00
Folkert
66a1ba00eb
1.65 clippy fixes
2022-11-03 16:20:37 +01:00
Luke Boswell
f3bdb5f321
updating rust package documentation
2022-11-03 20:00:06 +11:00
Anton-4
4ec43d9964
Closes #4423 , link build command refactoring
2022-10-31 21:32:38 +01:00
Anton-4
c99a1e0d7b
added Luke's editor ideas
...
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2022-10-28 17:40:27 +02:00
Anton-4
e2186ceae6
added extra newlines
2022-10-28 16:24:09 +02:00
Anton-4
3229f0fc98
fixed editor Ctrl+R
2022-10-28 12:49:48 +02:00
Anton-4
04899675e4
more editor ideas
2022-10-26 20:21:07 +02:00
Anton-4
8dff853830
Merge branch 'main' of github.com:roc-lang/roc into editor_launch_fix
2022-10-18 14:32:06 +02:00
Anton-4
71c879984b
back to old platform
2022-10-18 14:31:48 +02:00
Anton-4
eb727bd8b0
fixed links, minimal exceptions
...
Replaced lorem ipsum links with links to roc-lang. All exceptions added are due to problems with those sites and their interaction with programs like curl
2022-10-15 14:25:03 +02:00
Anton-4
652dbde26e
editor launch fix + new test
2022-10-15 12:36:06 +02:00
Christopher Duncan
e086187f3c
Repair links in Markdown
...
This resolves #3832
2022-10-11 18:36:15 -04:00
dependabot[bot]
1a9323ecdc
Bump libc from 0.2.133 to 0.2.135
...
Bumps [libc](https://github.com/rust-lang/libc ) from 0.2.133 to 0.2.135.
- [Release notes](https://github.com/rust-lang/libc/releases )
- [Commits](https://github.com/rust-lang/libc/compare/0.2.133...0.2.135 )
---
updated-dependencies:
- dependency-name: libc
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 13:00:20 +00:00
Ayaz
2f2ee654a9
Merge pull request #4024 from roc-lang/dependabot/cargo/pest_derive-2.3.1
...
Bump pest_derive from 2.1.0 to 2.3.1
2022-10-08 14:32:25 -05:00
Anton-4
eaacb86ad9
Merge branch 'main' of github.com:roc-lang/roc into simplify_examples
2022-09-28 19:48:46 +02:00
Ayaz Hafiz
f72a1f9a9a
REmove env_logger dep
2022-09-28 09:10:27 -05:00
dependabot[bot]
aa186930cd
Bump env_logger from 0.9.0 to 0.9.1
...
Bumps [env_logger](https://github.com/env-logger-rs/env_logger ) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases )
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md )
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.9.0...v0.9.1 )
---
updated-dependencies:
- dependency-name: env_logger
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-28 09:35:13 +00:00
Anton-4
076190a217
Merge branch 'main' of github.com:roc-lang/roc into simplify_examples
2022-09-24 16:55:37 +02:00
Anton-4
0ddc69e066
Merge branch 'main' of github.com:roc-lang/roc into simplify_examples
2022-09-24 16:49:50 +02:00
dependabot[bot]
b1e87981c0
Bump libc from 0.2.132 to 0.2.133
...
Bumps [libc](https://github.com/rust-lang/libc ) from 0.2.132 to 0.2.133.
- [Release notes](https://github.com/rust-lang/libc/releases )
- [Commits](https://github.com/rust-lang/libc/compare/0.2.132...0.2.133 )
---
updated-dependencies:
- dependency-name: libc
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-23 08:39:25 +00:00
dependabot[bot]
0079048944
Bump bumpalo from 3.10.0 to 3.11.0
...
Bumps [bumpalo](https://github.com/fitzgen/bumpalo ) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases )
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md )
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.10.0...3.11.0 )
---
updated-dependencies:
- dependency-name: bumpalo
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:56 +00:00
dependabot[bot]
84f58f59ff
Bump pest_derive from 2.1.0 to 2.3.1
...
Bumps [pest_derive](https://github.com/pest-parser/pest ) from 2.1.0 to 2.3.1.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.1.0...v2.3.1 )
---
updated-dependencies:
- dependency-name: pest_derive
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:45 +00:00
Ayaz
08c5903a48
Merge pull request #4017 from roc-lang/dependabot/cargo/serde-1.0.144
...
Bump serde from 1.0.139 to 1.0.144
2022-09-12 12:44:14 -04:00
dependabot[bot]
b3744a3647
Bump pest from 2.1.3 to 2.3.1
...
Bumps [pest](https://github.com/pest-parser/pest ) from 2.1.3 to 2.3.1.
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/commits/v2.3.1 )
---
updated-dependencies:
- dependency-name: pest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 10:33:06 +00:00
dependabot[bot]
555ed2c7fc
Bump serde from 1.0.139 to 1.0.144
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.139 to 1.0.144.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.139...v1.0.144 )
---
updated-dependencies:
- dependency-name: serde
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 05:28:20 +00:00
Jan Van Bruggen
a9a65fcf4b
Recategorize interactive apps as CLIs
2022-09-11 22:32:15 -06:00
Jan Van Bruggen
2eec200f09
Move helloWorld example up onto cli-platform
2022-09-11 22:22:50 -06:00
Jan Van Bruggen
4625a0a869
Rephrase CPU-related "platform"/"host" to "target"/"your machine"
2022-09-11 10:25:02 -06:00
Jan Van Bruggen
30fec8eacd
Add missing h1
s
2022-09-09 01:12:32 -06:00
Jan Van Bruggen
8bbfd68621
Add language to all fenced code blocks
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md040
2022-09-09 01:12:31 -06:00
Jan Van Bruggen
9cf7bdcccf
Use dashes for list markers
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md004
2022-09-09 01:12:31 -06:00
Jan Van Bruggen
de53e04fe9
Use 0, 2, 4, 6... for list indentation levels
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md007
2022-09-09 01:12:31 -06:00
Jan Van Bruggen
072a6bd002
Eliminate consecutive newlines
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md012
2022-09-09 01:12:30 -06:00
Jan Van Bruggen
3fa6e4c6ef
Ensure one trailing newline per .md
file
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md047
2022-09-09 01:12:30 -06:00
Jan Van Bruggen
56b858e537
Remove extra spaces after list markers
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md030
2022-09-07 23:18:17 -06:00
Jan Van Bruggen
19052e7009
Align list indentation
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md005
2022-09-07 23:18:04 -06:00
Jan Van Bruggen
c45db47cad
Replace emphasis underscores with asterisks
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md049
2022-09-07 23:18:03 -06:00
Jan Van Bruggen
26a1abfea8
Add blank lines around lists
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md032
2022-09-07 23:18:03 -06:00
Jan Van Bruggen
e3071a22b0
Add blank lines around headings
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md022
2022-09-07 23:18:03 -06:00
Jan Van Bruggen
6229eb54ca
Add blank lines around fenced code blocks
...
See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md031
2022-09-07 23:18:03 -06:00
Folkert de Vries
6dc86513a1
Merge pull request #3973 from roc-lang/dependabot/cargo/libc-0.2.132
...
Bump libc from 0.2.126 to 0.2.132
2022-09-06 18:48:36 +02:00