Commit graph

143 commits

Author SHA1 Message Date
Sam Mohr
f61b303a59
Merge branch 'main' into builtin-task 2024-07-03 00:42:48 -07:00
shua
d90da3af52
rm TotallyNotJson
TotallyNotJson.roc now lives on the farm in virtual-dom-wip as Json.roc.
Any reference in stdlib or builtins has been removed, as well as the
last places it was used (in python/ruby-interop examples).
2024-07-01 20:37:23 +02: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
4e5fdfbf52
Handle root type when loading from str 2024-06-08 19:46:41 -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
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
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
5112e064e5
Add module_path to can env instead of threading it through 2024-04-21 10:30:34 -03: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
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -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
Luke Boswell
e74501981e
fmt and clippy fixes 2024-03-20 12:31:04 +11:00
Luke Boswell
3b2e9e36b8
rename operator.rs to desugar.rs 2024-03-17 15:57:27 +11:00
Richard Feldman
ffd72b184b
Fix tests 2024-02-27 11:35:06 -05:00
Richard Feldman
6f84e24fa5
Merge remote-tracking branch 'origin/main' into more-dollars 2024-02-26 23:06:23 -05:00
JRI98
acbbdd0f7b
Improve handling of multi pattern unbound variables 2024-02-23 15:22:23 +00:00
Anton-4
b5f68bc020
Merge pull request #6525 from roc-lang/fix_text_contrast
less colors and more contrast in terminal
2024-02-20 15:46:13 +01:00