Commit graph

27 commits

Author SHA1 Message Date
Sam Mohr
7914f0c7d8
Fix clippy issue 2025-01-17 20:01:54 -08:00
Joshua Warner
5ebd6e0884
Only conditionally fuzz canonicalize 2025-01-11 20:24:35 -08:00
Joshua Warner
408379f8d3
Canonicalize the pattern in annotations 2025-01-11 20:24:30 -08:00
Joshua Warner
e760db55f5
Fix fuzz_module 2024-12-15 18:33:58 -08:00
Joshua Warner
a5bcf55d08
Implement initial version of fuzzing in CI (#7316)
* Implement initial version of fuzzing

* try nix config

* try rustup

* rustup run

* Fix syntax

* wip

* specific nightly

* wip

* specific nightly with+

* install

* locked
2024-12-11 12:57:24 +01:00
Joshua Warner
b4fa7294c7
Extend test_syntax to check that canonicalization doesn't panic on the input
Importantly, this would have caught the issue discovered in #7279, prior to that landing on main.
2024-12-06 17:13:10 -08:00
Joshua Warner
0855ffd9fb
Feedback: Add comment about not updating fuzz's Cargo.toml 2024-12-05 18:54:25 -08:00
Joshua Warner
b79d387b46
Fix fuzz Cargo.toml regression 2024-12-05 18:54:07 -08:00
Joshua Warner
f7a5f06e5b
Fix a bunch of bugs found in fuzzing 2024-12-01 12:40:19 -08:00
Anton-4
74d137cad4
Revert "Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2"
This reverts commit 364249a29d, reversing
changes made to 0e550a7f68.
2024-11-30 18:43:16 +01:00
Joshua Warner
364249a29d
Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2
Fix a bunch of parser/formatter bugs found in fuzzing
2024-11-29 17:33:57 -08:00
Joshua Warner
ed62bcc15a
Fix a bunch of parser/formatter bugs found in fuzzing
Notably:
* Unified how parens are formatted between (1) when we have a ParensAround, and (2) when we've decided an Apply needs to have parens
* Made unary minus require the be indented to the same level as any other expression continuation. (it used to accidentally have rules meant for binary operators applied)
* Don't apply extra indent to the backpassing continuation in the case that the call does itself require indentation
* Make `try@foo` correctly parse as `try @foo`, so that formatting doesn't change the tree when it adds that space
* Detect more cases where we need to outdent trailing e.g. {} blocks in applies
* Approximately a bagillion other things, 90% of which I added tests for, and none of which affected the formatting of examples or builtins
2024-11-29 16:25:59 -08:00
Luke Boswell
e43b78b354
update to workspace deps for miscellaneous 2024-11-29 11:37:39 +11:00
Luke Boswell
171ddde998
restore fuzzer 2024-11-27 11:25:14 +11:00
shua
2649716e4a
PR: old code not fmt'd 2024-11-27 00:42:56 +01:00
shua
fc10883c47
PR: add libfuzzer-sys back, test_syntax-fuzz to ws 2024-11-26 23:05:23 +01:00
Joshua Warner
4f32f43048
Implement block / indent based parsing
... and enforce that defs can only occur in blocks (or, inside parenthesized expressions)
2024-07-27 13:34:16 -07:00
Agus Zubiaga
057a18573a
New module header
Implements the new `module` header syntax as described in "module and package changes" [1]:

```
module [Request, Response, req]
```

The old syntax should still work fine, and is automatically upgraded to the new one
when running `roc format`.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
2024-05-01 10:39:12 -03:00
Joshua Warner
a24daeaa57
Fix syntax fuzzer cargo config 2024-04-20 11:21:36 -07:00
Brian Teague
60c639b60e
Consolidate gitignore
Keep certain files with no file extension

Keep specific files with no file extension

Delete all gitignore files
2024-01-10 22:16:04 -05:00
Bryce Miller
91e37293a2
abilities syntax has -> implements 2023-05-24 21:29:38 -04:00
Brendan Hansknecht
f42f61e271
run a toml formatter and then clean it up a bit 2023-03-06 19:47:57 -08:00
Brendan Hansknecht
4a89bee0a5
centralize package versions except for vendor and excluded 2023-03-06 19:29:09 -08:00
Brendan Hansknecht
5485c8a5b0
update to using workspace package spec 2023-03-06 16:36:18 -08:00
Brendan Hansknecht
43224dcca9
remove less important Cargo.lock files that we probably shouldn't track 2023-03-06 13:01:07 -08:00
Joshua Warner
94070e8ba6
Improve parsing of scalar literals
* Unify parsing of string literals and scalar literals, to (e.g.) ensure escapes are handled uniformly. Notably, this makes unicode escapes valid in scalar literals.
* Add a variety of custom error messages about specific failure cases of parsing string/scalar literals. For example, if we're expecting a string (e.g. a package name in the header) and the user tried using single quotes, give a clear message about that.
* Fix formatting of unicode escapes (they previously used {}, now correctly use () to match roc strings)
2023-01-07 15:12:52 -08:00
Joshua Warner
bfeddc470a
Move syntax tests to a dedicated crate
* test_fmt moves out of fmt crate
* test_parse _mostly_ moves out of parse crate and into `test_snapshots.rs` (some simple tests remain)
* now there's only two fuzz targets, fuzz_expr and fuzz_module, that cover both parsing and formatting
* added a system to auto-add new snapshot entries for new test files
* took some commented-out tests in `test_parse` and converted them to snapshot tests
* moved test_fmt's verification of formatting consistency into test_snapshots
* fixed a huge derp on my part where the fmt fuzzer in #4758 was completely useless (broken by refactoring just prior to submitting the PR)
* fixed a formatting bug found by fuzzing (bound_variable.expr.roc) - that I missed earlier due to ^^^ that derp
* no longer have roc_test_utils as a dependency in fmt - which was causing problems for the wasm build
2022-12-26 22:50:24 -08:00