Commit graph

174 commits

Author SHA1 Message Date
Joshua Warner
df915b936d
Feedback: add doc comments, verbiage changes, capitalize Roc, remove a resolved TODO 2024-07-28 14:45:32 -07:00
Richard Feldman
413de7f72e
s/roc/Roc in an error message
Signed-off-by: Richard Feldman <oss@rtfeldman.com>
2024-07-28 11:37:40 -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
Kiryl Dziamura
0086a531a2
add todo tests 2024-07-23 23:16:50 +02:00
Luke Boswell
b489c44b19
Merge remote-tracking branch 'remote/main' into builtin-task 2024-07-19 19:51:50 +10:00
Sam Mohr
74f05eca40
Fix broken test_reporting test 2024-07-07 19:02:31 -07: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
Sam Mohr
6f5f5f431e
Merge branch 'main' into builtin-task 2024-07-03 13:37:46 -07:00
Agus Zubiaga
13ba59a4cb
Fix hang on qualified import with builtin name 2024-07-03 12:40:53 -03:00
Sam Mohr
f61b303a59
Merge branch 'main' into builtin-task 2024-07-03 00:42:48 -07:00
shua
0faa1d5f20
test_gen: replace stdlib Json with inline implementation
Towards the goal of removing Json from stdlib, this change replaces
usage of TotallyNotJson in test_gen/gen_abilities with a simple usable
inline implementation of Encoder/DecoderFormatting.

Similarly, the use of TotallyNotJson in test_reporting is not necessary
at all and is replaced with a Decoder that wouldn't actually work, but
which does compile.
2024-07-01 20:30:05 +02:00
Sam Mohr
700c7ae9aa
Add Task as a built-in module/type 2024-06-25 00:03:56 -07:00
JRI98
f4551978ce
Handle multi pattern unbound list rest variables 2024-06-21 17:01:49 +01:00
Anton-4
4d00e9ad51
Merge branch 'main' into main
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-06-11 18:18:47 +02:00
John Konecny
a189e3ab20 Warnings are now yellow 2024-06-09 13:23:31 -04:00
Agus Zubiaga
6640893410
Fix test_reporting UNRECOGNIZED_PACKAGE header 2024-06-08 20:23:28 -03:00
Agus Zubiaga
0283bd1d24
UNKNOWN PACKAGE -> UNRECOGNIZED PACKAGE rename 2024-06-08 18:34:45 -03:00
Agus Zubiaga
7faff12cbf
Report unrecognized shorthands when loading from the root module 2024-06-08 14:12:01 -03:00
Agus Zubiaga
2da7ea394b
Add --main flag to specify app/package to resolve deps from 2024-06-07 17:09:44 -03:00
Richard Feldman
78d77e2f59
Revise wildcard and type var error message 2024-05-13 09:55:35 -04:00
Richard Feldman
18230a7a18
Make some reporting tests more editor-friendly
Previously editors would trim the trailing whitespace on save,
breaking the tests.
2024-05-13 08:22:35 -04:00
Richard Feldman
8357bd8c91
Revise errors for undeclared type vars in aliases 2024-05-12 21:20:11 -04:00
Agus Zubiaga
2e4306279c
Handle record update found in module params 2024-05-09 08:01:46 -03:00
Agus Zubiaga
f3b71c46e7
Handle record apply found in module params 2024-05-09 07:55:39 -03:00
Agus Zubiaga
b8280bf69a
Handle import params indent error in reporting 2024-05-09 07:49:21 -03:00
Agus Zubiaga
9be3358355
Module params record parse problem test 2024-05-09 07:45:33 -03:00
Agus Zubiaga
760ffaf68f
Report module params parse error 2024-05-09 07:27:58 -03:00
Agus Zubiaga
27a9f6051e
Report ingested file name syntax error 2024-05-06 23:46:06 -03:00
Agus Zubiaga
755e16cb10
Report exposing list end error in imports 2024-05-06 23:38:12 -03:00
Agus Zubiaga
dc18597a0e
Report unfinished exposing in imports 2024-05-06 23:24:56 -03:00
Agus Zubiaga
f81985533c
Report import lowercase alias 2024-05-06 23:16:18 -03:00
Agus Zubiaga
97ed8fdbbd
Report unfinished import as 2024-05-06 23:03:40 -03:00
Agus Zubiaga
bfb77b78cb
Report import ending syntax error 2024-05-06 22:22:00 -03:00
Agus Zubiaga
007e03891e
Report module name / path syntax error in imports 2024-05-06 21:00:17 -03:00
Agus Zubiaga
520dc389f3
Report ingested file annotation syntax error 2024-05-05 17:45:37 -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
Richard Feldman
00950d2a0e
Update insta snapshots 2024-04-26 06:59:01 -04:00
Richard Feldman
6571c18a35
Update tests 2024-04-25 23:10:45 -04:00
Agus Zubiaga
7ebfc6d06d
Support both inline and header imports
Load will now convert header imports to inline import defs, so that
we can support both temporarily.
2024-04-20 19:04:09 -03:00
Agus Zubiaga
979aff8bf7
Explicit builtin import warning
We will now show a warning if a builtin is imported explicitly,
since this is unncessary.

We will not show the warning if they expose functions from the builtin:

	import Dict exposing [isEmpty]

However, we will show a special warning if they expose types from it:

	import Dict exposing [Dict, isEmpty]
2024-04-20 12:35:46 -03:00
Agus Zubiaga
1f347f6ca1
Fix package module resolution in inline imports
We were still passing `ModuleIds` from `load` to `can`, but now
that imports can appear in any scope, we don't know which package
an unqualified module name belongs to from the top level.

We now pass `PackageModuleIds` instead  and keep a Map of `ModuleName` to
`ModuleId` in `Scope`.

This also allow us to import multiple modules with the same name from different
packages as long as a unique alias is provided.
2024-04-20 12:16:37 -03:00
Luke Boswell
c5cba98381
Merge remote-tracking branch 'remote/main' into suffixed-bang 2024-04-16 06:42:31 +10:00
Luke Boswell
f9771a9983
split test_utils 2024-04-15 20:30:34 +10:00
Luke Boswell
93ef5e42dc
fix tests, make clippy happy 2024-04-14 13:45:07 +10:00
Richard Feldman
ec64da3416
Merge pull request #6627 from roc-lang/default-value-record
Change docs/errors from "optional" to "default value" record fields
2024-04-04 22:25:45 -04:00
Brendan Hansknecht
482c084096
Change docs/errors from "optional" to "default value" record fields
I strongly believe that seeing the word "optional" is priming people wrong when it comes to this feature.
Especially given roc dose not have an `Optional/Option/Maybe` type, so users look for an alternative and find this.

This PR changes the name to "default value record fields".
It updates all docs and errors.
It does not update compiler internal naming.
That can be updated in a follow up PR if we want to, but I am also fine leaving it cause it is not exposed to users.
2024-04-03 08:55:35 -07:00
Brendan Hansknecht
6dc5bfb1b7
Use roc_target over target_lexicon
Tailors a target class for our needs.
Replaces tons of uses across the entire compiler.
This is a base for later adding new targets like thumb.
2024-03-31 10:50:26 -07:00
Richard Feldman
ffd72b184b
Fix tests 2024-02-27 11:35:06 -05:00