Commit graph

13739 commits

Author SHA1 Message Date
ayazhafiz
e946b972f7 Only recursive tag unions are relevant in illegal cycles 2022-02-12 20:41:19 -05:00
ayazhafiz
b8defcbc75 Use freshly-instantiated lambda variables 2022-02-12 20:03:39 -05:00
Folkert de Vries
e0014e8865
Merge pull request #2473 from rtfeldman/roc_std_deref
Add Deref and DerefMut to RocList and RocStr
2022-02-13 00:56:50 +01:00
Brendan Hansknecht
1af80316d4 Fix mutability 2022-02-12 13:02:02 -08:00
Brendan Hansknecht
9bbda7ead0 Add Deref and DerefMut to RocList and RocStr
This enables things like implicitly using it as a slice and using `.iter()` instead of `into_iter()`
2022-02-12 12:57:53 -08:00
ayazhafiz
4dbdf3a58b Check that instantiated lambda set vars indeed only have vars 2022-02-12 11:32:32 -05:00
ayazhafiz
33148cb1a4 Functions are compound types 2022-02-12 10:54:57 -05:00
Anton-4
3346eb4f2c
update wgpu, winit and wgpu_glyph 2022-02-12 13:55:21 +01:00
Anton-4
59a0c47038
succesfull rendering of multi-level rects and texts 2022-02-12 11:55:29 +01:00
Richard Feldman
71f2444397
s/Int/Nat in a comment 2022-02-11 21:26:39 -05:00
Richard Feldman
e1cc4cbde6
Fix comment 2022-02-11 21:25:08 -05:00
Brian Carroll
a9df6f4ff9 test_gen: create a getter for wasm panic messages 2022-02-12 00:19:52 +00:00
Brian Carroll
63c33d82e3 wasm: Improve dead code elimination to handle indirect calls 2022-02-12 00:09:35 +00:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first 2022-02-11 16:10:29 -07:00
Jan Van Bruggen
92e0f8714f
Swap List.repeat args order to put the list first 2022-02-11 16:10:29 -07:00
Anton-4
51d86f101f
display example text on screen 2022-02-11 20:15:09 +01:00
Brian Carroll
fcda6fabe2 wasm: replace a panic! with an internal_error! 2022-02-11 18:46:18 +00:00
Brian Carroll
54788b0357 wasm: Create a full model of the ElementSection 2022-02-11 18:44:47 +00:00
ayazhafiz
55769caad6 Redundant clone 2022-02-11 08:52:37 -05:00
ayazhafiz
c71854d5a4 Remove opt_rec_var 2022-02-11 08:51:08 -05:00
ayazhafiz
8c0e39211d Instantiate recursive aliases to their smallest closures
Now, when we have two aliases like

```
T a : [ A, B (U a) ]
U a : [ C, D (T a) ]
```

during the first pass, we simply canonicalize them but add neither to
the scope. This means that `T` will not be instantiated in the
definition of `U`. Only in the second pass, during correction, do we
instantiate both aliases **independently**:

```
T a : [ A, B [ C, D (T a) ] ]
U a : [ C, D [ A, B (U a) ] ]
```

and now we can mark each recursive, individually:

```
T a : [ A, B [ C, D <rec1> ] ] as <rec1>
U a : [ C, D [ A, B <rec2> ] ] as <rec2>
```

This means that the surface types shown to users might be a bit larger,
but it has the benefit that everything needed to understand a layout of
a type in later passes is stored on the type directly, and we don't need
to keep alias mappings.

Since we sort by connected components, this should be complete.

Closes #2458
2022-02-11 08:43:33 -05:00
Anton-4
440a3cd15b
started moving tokenizer and grammar for syntax_highlighting 2022-02-11 13:54:10 +01:00
Anton-4
5fa368ff0a
Merge pull request #2467 from rtfeldman/fix_failing_test
Fix a failing test
2022-02-11 13:23:14 +01:00
Jan Van Bruggen
fa466cd8d8
Fix a failing test
How did this pass CI testing?

Output from `cargo test --release`:
```
failures:

---- test_parse::comment_after_def stdout ----
The source code for this test did not successfully parse!

thread 'test_parse::comment_after_def' panicked at 'assertion failed: `(left == right)`

Diff < left / right > :
 [
<    |L 0-0, C 0-7| SpaceAfter(
>    @0-7 SpaceAfter(
         SpaceBefore(
             Body(
<                |L 0-0, C 0-3| Identifier(
>                @0-3 Identifier(
                     "foo",
                 ),
<                |L 0-0, C 6-7| Num(
>                @6-7 Num(
                     "1",
                 ),
             ),
             [],
         ),
         [
             LineComment(
                 " comment after",
             ),
         ],
     ),
 ]

', compiler/parse/tests/test_parse.rs:291:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    test_parse::comment_after_def

test result: FAILED. 164 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass '-p roc_parse --test test_parse'
```
2022-02-11 04:20:29 -07:00
Brian Carroll
97c939c191 test_gen: reduce wasm test time from 1m30s to 15s using Wasmer's singlepass compiler 2022-02-11 08:16:45 +00:00
Brian Carroll
57179eb458 test_gen: comments about wasm panics 2022-02-11 08:12:36 +00:00
Brian Carroll
5f64f32a4a wasm: Better implementation of roc_panic in tests 2022-02-11 07:33:49 +00:00
ayazhafiz
c064c50036 Catch illegal alias cycles more strictly
Part of #2458
2022-02-10 22:12:33 -05:00
Richard Feldman
fdfc6b4210
Merge pull request #2465 from rtfeldman/www
Update `www/` content
2022-02-10 16:41:06 -05:00
Richard Feldman
8146d19275
Add link to source code to www/index.html 2022-02-10 16:35:11 -05:00
Richard Feldman
30f91d1968
Comment out a bunch of stuff in build.sh to fix it for now. 2022-02-10 16:35:11 -05:00
ayazhafiz
13552b11a6 Check self- and mutually-recursive aliases in the same pass 2022-02-10 08:15:48 -05:00
Anton-4
d6681f4e0a
Merge pull request #2160 from rtfeldman/editor-comments
support tld comments in docs and editor(reading only)
2022-02-10 11:49:10 +01:00
Brian Carroll
2af4016f34 wasm: improve the HTML debugger's WASI syscall implementations 2022-02-10 10:15:59 +00:00
Brian Carroll
55465d15a0 wasm: include Name section in output binary, for debugging 2022-02-10 10:15:19 +00:00
Brian Carroll
8c5fe2ae22 wasm: implement Stmt::RuntimeError 2022-02-10 10:13:54 +00:00
Folkert de Vries
c99f8b23e7
Merge pull request #2461 from rtfeldman/wasm-compiler-host
Support Wasm as a compiler host
2022-02-10 00:08:18 +01:00
Brian Carroll
0d08c97e44 wasm: enable a test that has a Stmt::RuntimeError 2022-02-09 17:23:36 +00:00
Brian Carroll
abfa4b1522 test_gen: allow non-llvm tests to expect errors 2022-02-09 17:23:36 +00:00
Brian Carroll
4b585cc6c6 wasm: More explicit todo! statements 2022-02-09 17:23:36 +00:00
Brian Carroll
c61a18a200 Use custom macros for static assertions 2022-02-09 17:16:43 +00:00
Brian Carroll
d8b76b317b repl: replace [u8; 8] with u64 in static assertions 2022-02-09 16:34:11 +00:00
Brian Carroll
a0ccae2865 repl: Create dumy Wasm implementations of SystemTime and Duration 2022-02-09 16:34:11 +00:00
Brian Carroll
8e370a32b6 repl: update some static_asserts for 32-bit compiler build 2022-02-09 16:34:11 +00:00
Folkert de Vries
5661d281c6
Merge pull request #2452 from rtfeldman/wasm-repl
Wasm REPL
2022-02-09 15:30:36 +01:00
Anton-4
2741dd6c6d
apply fixes, more tests 2022-02-09 12:38:19 +01:00
Anton-4
9de6ef6742
record update inside apply fix 2022-02-08 19:30:32 +01:00
Anton-4
9ff7ec1e68
indent fixes, fixed ambiguous DOT 2022-02-08 17:37:33 +01:00
Anton-4
c55fe63c4e
Merge pull request #2459 from rtfeldman/add-build-command
Added `cargo build` to BUILDING_FROM_SOURCE
2022-02-08 17:23:23 +01:00
Brian Carroll
49524731c3 repl: remove stale comment 2022-02-08 11:03:48 +00:00