Richard Feldman
3e27e18566
Merge remote-tracking branch 'origin/main' into remove-nat
2024-01-29 07:23:58 -05:00
Richard Feldman
0681929d6d
Update snapshot syntax tests
2024-01-28 17:34:47 -05:00
Anton-4
30a5a2cfac
change hashtag formatting
2024-01-28 18:15:24 +01:00
Richard Feldman
bf660ad094
Remove Nat from tests
2024-01-26 16:19:52 -05:00
Richard Feldman
09574203ce
Update to basic-cli 0.8.1
2024-01-26 16:02:30 -05:00
Agus Zubiaga
11e0202eb9
Parse inline imports and ingested files at the expression level
...
```
numbers =
import "numbers.json" as numbersJson : Str
import json.Decode exposing [decode, list, int]
numbersJson
|> decode (list int)
|> Result.withDefault []
```
2024-01-20 08:35:50 -03:00
Agus Zubiaga
2d93f0c3f1
Extract ModuleImport/IngestedFileImport into structs for reuse
2024-01-20 08:35:50 -03:00
Agus Zubiaga
4d6e641864
Parse and format inline ingested file imports
2024-01-20 08:35:50 -03:00
Agus Zubiaga
42e755677c
Simply import parsing and formatting by using header::KeywordItem
2024-01-20 08:35:50 -03:00
Agus Zubiaga
65ce811587
Parse and format import package shorthand
...
The original proposal [1] suggested dropping the package shorthand,
but we later decided to keep it [2] to improve UX.
[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit?usp=sharing
[2] 385104011
2024-01-20 08:35:50 -03:00
Agus Zubiaga
c56091ee3e
Module Params' proposal import syntax
...
I previously implemented the syntax in "Proposal: Module and Package Changes" [1]:
```
import [map, map2] from JsonDecode as JD
```
However, we decided [2] to use the one that appears in "Proposal: Module Params" [3]:
```
import JsonDecode as JD exposing [map, map2]
```
The new implementation also now supports comments and newlines between all the tokens.
[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
[2] 405410612
[3] https://docs.google.com/document/d/110MwQi7Dpo1Y69ECFXyyvDWzF4OYv1BLojIm08qDTvg/edit
2024-01-20 08:35:50 -03:00
Agus Zubiaga
5cd084b73c
Parse and format inline import with exposed names
2024-01-20 08:35:50 -03:00
Agus Zubiaga
76d799ea13
Parse and format aliases in import defs
2024-01-20 08:35:50 -03:00
Agus Zubiaga
933fde77a0
Parse and format top-level import defs with no alias or exposed members
2024-01-20 08:35:50 -03:00
Anton-4
cf96010543
update to basic-cli 0.7.1
2023-12-23 16:54:59 +01:00
ptaszor3
7162fbddd3
Fixed the multiline dbg formatting
2023-12-10 19:58:09 +01:00
ptaszor3
6a6d5cebc0
resolved issue 6188 and added some tests
2023-12-10 19:57:49 +01:00
Anton-4
a050933955
use latest basic-cli
2023-12-01 12:33:09 +01:00
Agus Zubiaga
c22c2259c0
Add type annotation in where_ident test
2023-09-30 01:53:49 -03:00
Agus Zubiaga
ebc3aab91f
Allow where
to be used as an identifier (except in type vars)
2023-09-30 01:48:10 -03:00
Anton-4
ac9421c1b4
basic-cli 0.4.0 -> 0.5.0
2023-08-12 19:34:33 +02:00
Richard Feldman
0176b9310d
Update snapshot tests
2023-08-10 21:51:01 -04:00
Richard Feldman
2da41be29f
Merge remote-tracking branch 'origin/main' into abilities-syntax
2023-08-10 20:36:01 -04:00
Richard Feldman
1d5c5b25ec
Merge remote-tracking branch 'origin/main' into linux64
2023-07-11 11:33:31 -04:00
Kiryl Dziamura
1bb3c3d1dd
Make has
have 4 identation spaces
2023-07-04 11:24:40 +02:00
Joshua Warner
654248ad47
Allow spaces before and after the colon in the packages
header section
...
Fixes #4902
2023-07-03 15:46:50 -07:00
Richard Feldman
bdb93fda5e
Update to basic-cli 0.4.0
2023-06-22 16:58:50 -04:00
Bryce Miller
e463ccf4a6
merge main
2023-06-07 20:36:54 -04:00
Ajai Nelson
2e5fef5231
Improve error messages involving ignored variables
...
Fix #3987
2023-06-06 19:46:15 -04:00
Bryce Miller
cb08225bf0
|
-> where
2023-06-05 20:19:00 -04:00
Bryce Miller
c68807bc5a
has -> implements in roc code
2023-05-26 20:39:01 -04:00
Bryce Miller
91e37293a2
abilities syntax has
-> implements
2023-05-24 21:29:38 -04:00
Joshua Warner
b5f284cd78
Fix several fmt+parse bugs found by fuzzing
2023-02-19 12:37:33 -08:00
Joshua Warner
2541a09273
Fix formatting of initial newlines in collections
...
Fixes #5015
2023-02-17 09:08:50 -08:00
Ayaz
9340a67e87
Merge pull request #4993 from joshuawarner32/tuple-gen-tuple-backend-experiment
...
Implement mono / code generation for tuples
2023-02-08 10:42:51 -05:00
Joshua Warner
3fee0d3e8f
Fix a bunch of bugs in parsing/formatting found by fuzzing
2023-02-07 20:25:56 -08:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples
2023-02-07 18:54:50 -08:00
Joshua Warner
31a4eb2bfd
Fix parsing of tuple accessors after an identifier - e.g. myIdent.2
2023-01-30 21:12:01 -08:00
Joshua Warner
a1cd114198
Add a Malformed trait, and assert that 'passing' tests don't produce a malformed result
2023-01-25 21:01:05 -08:00
Joshua Warner
d876abb04b
Fix formatting of backpassing in a nested def with no newline
...
Fixes #4338
2023-01-16 09:31:08 -08:00
Joshua Warner
3b51d7cd13
Fix multi-backpassing in top-level defs
...
Fixes #4821
2023-01-15 10:39:21 -08:00
Joshua Warner
0b8e68f70d
Fix approximately a bajillion fmt and parsing bugs
...
(discovered by fuzzing)
There's more to come, but this seems like a good batch for now.
2023-01-13 18:20:44 -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
07ebc81cba
Be more lenient with indentation in record parsing
...
... and extract a shared helper with collection_trailing_sep_e, thereby resolving some inconsistencies with normal collection parsing.
... and delete some dead code while I'm at it
2023-01-02 18:53:15 -08:00
Joshua Warner
0da50a612d
Be more lenient with required indentation in collections
...
... and also remove a bunch of now-dead errors that can't be triggered.
2023-01-01 17:49:51 -08:00
Folkert
c1c8328e25
update tests
2022-12-30 23:21:41 +01:00
Folkert
e9196f3c0b
parse and format pattern as
2022-12-30 17:50:17 +01: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