Commit graph

249 commits

Author SHA1 Message Date
Agus Zubiaga
b451e69b20
Merge branch 'main' into typecheck-module-params 2024-08-12 22:27:16 -03:00
Joshua Warner
d25c048d48
Move Full from fmt to parse and reorganize confusingly-named Module ast type 2024-08-07 23:01:49 -07:00
Agus Zubiaga
762799052e
Merge branch 'main' into typecheck-module-params 2024-08-07 18:55:33 -03:00
Sam Mohr
cb8040f629
Ignore underscore-prefixed fields in record builders 2024-08-06 22:49:35 -07:00
Aidan
ddb58a2cd5 spaces_middle -> lines_between 2024-07-29 13:06:48 -04:00
Aidan
2529fa0721 get rid of extra newlines 2024-07-29 11:10:16 -04:00
Aidan
91fdd903e7 comment -> spaces_middle 2024-07-29 10:04:32 -04:00
Aidan
125990855f Merge branch 'main' into store-all-space-between-annotation-body 2024-07-29 09:46:05 -04:00
Aidan
7fe052322c update test, fix logic 2024-07-27 16:55:13 -04: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
Aidan
3c78b4fb86 functional changes 2024-07-27 12:16:04 -04:00
Sam Mohr
fe1b6d71fc
Update from PR comments 2024-07-07 18:33:20 -07:00
Sam Mohr
f415017c90
Implement new builder syntax alongside old one 2024-07-07 03:28:59 -07:00
Agus Zubiaga
90c7745989
Capture import params location for better errors 2024-07-02 11:09:56 -03:00
Agus Zubiaga
7ac72159e9
Parse module params loc and rename to pattern 2024-07-02 04:10:45 -03:00
Kiryl Dziamura
de9ed734c5
remove EmptyDefsFinal 2024-07-01 18:45:23 +02:00
Evan Relf
d678f1c049 Format shebangs correctly
Fixes the regression I described in [#1135].

[#1135]: https://github.com/roc-lang/roc/issues/1135
2024-06-19 15:07:22 -07:00
Agus Zubiaga
b36f88fd13
Format module params in imports 2024-05-09 07:42:10 -03:00
Agus Zubiaga
e5a09b5de6
Parse module params in import 2024-05-09 07:42:07 -03:00
Agus Zubiaga
370013b960
Format module header with params 2024-05-09 07:27:58 -03:00
Agus Zubiaga
5b1a3c8f03
Parse params in module header
module {echo, read} -> [menu]

Formatter isn't implemented yet.
2024-05-09 07:27:43 -03:00
Agus Zubiaga
4b8b36529d
Remove unnecessary & ref 2024-05-05 17:08:34 -03:00
Agus Zubiaga
22716cea45
Format ingested file with optional annotation 2024-05-05 16:56:49 -03:00
Agus Zubiaga
e3b600c282
New package header syntax
Implements the new package header syntax as discussed in Zulip [1].

package [Csv] {
    parser: "../parser/main.roc"
}

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] 418444862
2024-05-01 10:49:03 -03:00
Agus Zubiaga
8dedd9f03c
New app header syntax
Implements the new app header syntax as discussed in Zulip [1].

    app [main] {
	cli: platform "../platform/main.roc",
	json: "../json/main.roc"
    }

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] 418444862
2024-05-01 10:49:01 -03: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
Agus Zubiaga
a8a829aadd
Merge branch 'main' into inline-imports 2024-04-28 00:11:29 -03:00
Luke Boswell
db4607125b
remove suffixed from Pattern 2024-04-28 08:47:08 +10:00
Luke Boswell
2fe03e6c91
remove suffixed from Expr::Var 2024-04-28 08:47:08 +10:00
Joshua Warner
7c53cf0cd7
Fixup tests 2024-04-28 08:47:07 +10:00
Joshua Warner
6080c12ca8
Parse ! suffixes as an Expr::TaskAwaitBang instead of using suffix field in ident 2024-04-28 08:47:07 +10:00
Agus Zubiaga
7efc7a4a3e
Canonicalize ingested files directly instead of creating AST nodes 2024-04-23 18:55:41 -03:00
Agus Zubiaga
3217e5a3f0
Allow dots in import module names
We found some issues with the private submodules part of the proposal [1],
and we decided to keep module directories for now.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit#heading=h.x84bh32l37em
2024-04-20 12:33:02 -03:00
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -03:00
Luke Boswell
129ca94733
remove unit type from EmptyDefsFinal 2024-04-14 13:45:07 +10:00
Luke Boswell
c32fa5b600
support optional suffied last def 2024-04-14 13:45:06 +10:00
Luke Boswell
8b9e08bd76
WIP try simplification 2024-04-14 13:45:05 +10:00
Luke Boswell
d08a51b134
cargo fmt 2024-04-14 13:45:02 +10:00
Luke Boswell
584d41f621
fix ! bug for Record and Tuple Access 2024-04-14 13:45:02 +10:00
Luke Boswell
3c3e523b45
add suffixed to Identifer and QualifiedIdentifier 2024-04-14 13:45:00 +10:00
Luke Boswell
0a3b9c34b3
add suffixed:u8 to Expr::Var 2024-04-14 13:45:00 +10:00
Luke Boswell
42fdcb7ff1
Make unit assignment optional for suffixed defs 2024-04-14 13:44:59 +10:00
Jonathan Schear
723c390f52
Treat two hash marks followed by text as a doc comment 2024-03-24 14:31:27 -04:00
Luke Boswell
e2557067c8
add nested snapshot for suffixed expr 2024-03-15 14:40:09 +11:00
Luke Boswell
8bbbd768ec
add snapshot test for suffixed expr 2024-03-15 14:39:21 +11:00
Anton-4
1efd7615f0
stylistic improvements 2024-03-13 20:27:23 +01:00
Eli Dowling
cc4453b301
remove alias 2024-03-12 06:42:37 +10:00
Eli Dowling
c89c8c3e95
fix formatter crash 2024-03-12 06:42:27 +10:00
Richard Feldman
6978ca7bf3
roc format now auto-upgrades string interpolation 2024-02-26 23:08:25 -05:00
Anton-4
6338e54205
improve wording 2024-01-28 18:33:12 +01:00