Agus Zubiaga
2469a3aa2d
Merge pull request #7050 from roc-lang/arg-patterns-as
2024-09-02 14:02:17 -03:00
Agus Zubiaga
2486ce0e48
fmt: Add parens around as
patterns in arguments
2024-09-02 11:54:34 -03:00
Anton-4
02cf61f985
Merge pull request #7038 from mulias/expr-dbg
...
Support `dbg` in expressions
2024-09-02 13:30:32 +02:00
Anton-4
e7a44430fd
update to basic cli 15
2024-08-31 14:30:07 +02:00
Elias Mulhall
56c5b790a7
Refactor dbg expression parsing to work more like function application
...
Instead of parsing dbg with an expression block, parse the dbg keyword
with no additional arguments. This way the parser treats dbg just like a
variable in function application. We desugar by pattern matching on
`Apply(Dbg, args, called_via)` nodes. This changes the output of syntax
tests since the initial AST is different, but does not change the output
of can or mono.
Add two new errors for dbg in expression position with either no args or
too many args. This is similar to the error behavior of `crash`.
Continue to parse dbg statements with an expression block, as before.
2024-08-29 15:36:48 -04:00
Anton-4
7938e4bdc8
basic-cli 0.15, test fixes
2024-08-28 18:39:15 +02:00
Elias Mulhall
335265e15c
Parse dbg in expression position
...
Add dbg parsing logic everywhere we parse normal expressions. Add
special case to statement parsing to handle a series of statements
ending in a `dbg` in expression position.
Rename existing `dbg_help` function to `dbg_stmt_help`, similarly rename
syntax snapshot test files to specify which ones are for dbg statements.
2024-08-28 11:53:44 -04:00
Elias Mulhall
43d932df3b
Update parser AST to support dbg as both a statment and expression
...
Make `Expr::Dbg` node specific to dbg expressions, add `Expr::DbgStmt`
for dbg statements. Debug expressions don't have a continuation branch.
Support formatting both kinds of `Dbg` nodes.
2024-08-28 11:53:44 -04:00
Luke Boswell
10241b3f98
Merge remote-tracking branch 'remote/main' into builtin-task
2024-08-24 09:53:08 +10:00
Anton-4
44b8abdead
update to basic-cli 0.14
2024-08-23 15:50:05 +02:00
Sam Mohr
12df3a04de
Merge attempt
2024-08-19 23:34:05 -07:00
Sam Mohr
b1a972ab21
Implement &foo
record updater syntax sugar
2024-08-16 01:41:59 -07:00
Sam Mohr
3bc5c1dc12
Combine ! and ? into single TrySuffix AST node
2024-08-14 22:14:08 -07:00
Sam Mohr
7e72541a79
Merge branch 'main' into builtin-task
2024-08-12 23:12:38 -07:00
Agus Zubiaga
b451e69b20
Merge branch 'main' into typecheck-module-params
2024-08-12 22:27:16 -03:00
Joshua Warner
0abea91796
Rename Full -> FullAst
2024-08-10 16:06:01 -07: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
00bc699642
Add syntax tests for record builder
2024-08-06 22:49:35 -07:00
Sam Mohr
8288af3156
Merge branch 'main' into builtin-task
2024-07-31 13:36:32 -07:00
Joshua Warner
ca037c5d0e
Merge branch 'main' into fix-deprecated-interpolated-formatting
2024-07-29 17:40:23 -07:00
Joshua Warner
4e8b36adbf
Fix auto-fixing of deprecated interpolated strings
2024-07-29 17:37:55 -07:00
Aidan
ddb58a2cd5
spaces_middle
-> lines_between
2024-07-29 13:06:48 -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
Luke Boswell
eca453d07f
Merge remote-tracking branch 'remote/main' into builtin-task
2024-07-29 16:05:51 +10:00
Aidan
62dbe9fb53
update snapshots
2024-07-27 17:19:02 -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
Luke Boswell
b489c44b19
Merge remote-tracking branch 'remote/main' into builtin-task
2024-07-19 19:51:50 +10:00
Anton-4
3a36d84c45
update to basic-cli 0.12
2024-07-10 20:07:03 +02:00
Kiryl Dziamura
2cad4b3e21
update test snapshots
2024-07-08 11:51:29 +02:00
JRI98
25084b18ec
Fix handling of spaces after for as
2024-07-05 09:40:56 +01:00
Sam Mohr
f61b303a59
Merge branch 'main' into builtin-task
2024-07-03 00:42:48 -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
819cfd6035
fix test snapshots
2024-07-01 19:48:00 +02:00
Sam Mohr
700c7ae9aa
Add Task as a built-in module/type
2024-06-25 00:03:56 -07:00
Agus Zubiaga
058079e5cd
Update spaces in import_with_params result ast
2024-05-09 08:02:29 -03: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
08825a9e90
Add module with optional param syntax test
2024-05-09 07:27:58 -03:00
Agus Zubiaga
370013b960
Format module header with params
2024-05-09 07:27:58 -03:00
Agus Zubiaga
760ffaf68f
Report module params parse error
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
2a8ecbba28
Do not drop import parse errors
2024-05-07 22:39:43 -03:00
Agus Zubiaga
8418610dd9
Require newline after import
2024-05-06 22:15:52 -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