Ayaz Hafiz
1edbe32252
Fix parse tests
2022-04-07 17:22:05 -04:00
Ayaz Hafiz
66ec1b4a84
Basic canonicalization and error checking for abilities
2022-04-07 17:21:17 -04:00
Ayaz Hafiz
a3ac68a41f
Split up Defs into TypeDef and ValueDef
...
Just a refactoring PR. This is useful because during canonicalization
we always process type defs first, then value defs. With abilities this
distinction continues to grow; in that case, we have patterns associated
with types that we want to process before patterns from values.
2022-04-06 22:18:57 -04:00
Ayaz Hafiz
bd8333ebb1
Parse multiple abilities behind each other
2022-04-06 11:20:51 -04:00
Ayaz Hafiz
2dc0445f46
s/AbilityDemand/AbilityMember
...
This is a better name
2022-04-06 11:20:34 -04:00
ayazhafiz
d7abc3897b
Parse abilities
2022-03-12 21:29:06 -06:00
Jan Van Bruggen
99c825aa99
Simplify example platform names
2022-03-07 19:59:29 -07:00
Richard Feldman
887a07b455
Merge pull request #2596 from rtfeldman/joshuawarner32/listclosing-braces
...
Allow closing braces in collections to be at any indent level
2022-02-28 20:00:44 -05:00
Joshua Warner
611d1784a9
Add tests
2022-02-26 14:15:46 -08:00
Joshua Warner
b2bb9dcd65
improve parser snapshot test error messages
2022-02-26 13:34:53 -08:00
Joshua Warner
333234aad9
Improve error message for no_extra_snapshot_test_files test
2022-02-26 13:32:20 -08:00
Brendan Hansknecht
f7c0e2ef19
Merge remote-tracking branch 'origin/trunk' into single-quote-literal
2022-02-24 10:13:39 -08:00
ayazhafiz
6104a27b45
Parse opaque references
2022-02-19 21:30:42 -05:00
ayazhafiz
3c10ad2a9f
Test for opaque definitions
2022-02-19 20:51:12 -05:00
ayazhafiz
8ce81e4607
AliasHeader -> TypeHeader
2022-02-19 17:51:56 -05:00
Jan Van Bruggen
f328ff5661
Remove leading newlines from code files
2022-02-13 14:55:34 -07: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
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
Folkert
f02db3961a
fix parse tests
2022-02-04 22:51:18 +01:00
Folkert
f1ebc523b6
Merge remote-tracking branch 'origin/trunk' into hook-up-hosted-modules
2022-02-04 00:07:23 +01:00
Folkert
885500712c
remove old Effect module things
2022-02-03 23:55:02 +01:00
Folkert
a98635ed06
update other examples
2022-02-03 22:45:15 +01:00
ayazhafiz
a6f7579c07
Parse and expand numeric bounds in canonicalization pass
2022-02-01 22:50:46 -05:00
ayazhafiz
f7a055fc78
Fix parser tests
2022-02-01 22:49:52 -05:00
ayazhafiz
320827167f
Parse number literal width suffixes
...
Supports [u,i][8,16,32,64,128] and [nat,dec]
Part of #2350
2022-02-01 22:48:48 -05:00
Richard Feldman
2eb9243942
Add parse tests for hosted modules
2022-01-30 20:40:50 -05:00
ayazhafiz
8ae2d9d407
Parse interfaces with leading newlines
...
Closes #2420
2022-01-29 23:58:41 -05:00
Richard Feldman
4fadc775e8
Add parse tests snapshot
2022-01-23 12:20:35 -05:00
Richard Feldman
1ab621dd54
Support optional spaces in app header types
2022-01-23 12:02:34 -05:00
Richard Feldman
01942fd98e
Parse app header provided types
2022-01-23 11:52:59 -05:00
Richard Feldman
c1c0ffb25f
Use UppercaseIdent over PlatformRigids
2022-01-23 11:13:23 -05:00
Richard Feldman
620e3f2913
parse tests for provided/required types in module headers
2022-01-23 10:11:17 -05:00
Jan Van Bruggen
fb66467343
Remove trailing spaces from test snapshots
2022-01-18 22:33:24 -07:00
Joshua Warner
f22f96843e
Refactor ParseProblem
...
* Remove the `pos` field, which was always being assigned Position::default()
* Remove one use of this `pos`, by removing the never-used SyntaxError::ConditionFailed variant
* Adjust the other use to do what was probably intended - which is to say, pointing to the beginning of the def with the error
* Rename to FileError, reuse `SourceError` as an inner field, to avoid duplicating the `bytes`
2022-01-03 20:10:50 -08:00
Joshua Warner
9557c234cb
Update recently added tests
2022-01-01 18:20:57 -08:00
Joshua Warner
70156b0a90
Simplify advancing
2022-01-01 18:20:05 -08:00
Joshua Warner
8e1241adea
Remove line/column fields
2022-01-01 18:20:05 -08:00
Joshua Warner
eb35e9914f
Fix tests
2022-01-01 18:20:05 -08:00
Joshua Warner
4b04ec6bbc
Add Position::offset, and recompute line/column info based on source
2022-01-01 18:20:05 -08:00
Joshua Warner
721233f9c8
More incremental changes
2022-01-01 18:20:05 -08:00
Joshua Warner
bd7b1e5013
Make Loc::new take Positions
2022-01-01 18:20:05 -08:00
Anton-4
f941e30b86
Merge branch 'trunk' of github.com:rtfeldman/roc into editor-comments
2022-01-01 11:10:54 +01:00
ayazhafiz
0c81302d29
Admit tag destructuring in definitions
2021-12-30 19:50:50 -06:00
Folkert de Vries
bb935948aa
Merge pull request #2276 from rtfeldman/i/2265
...
Parse "as" aliases into tag/args rather than arbitrary annotations
2021-12-27 20:56:48 +01:00
ayazhafiz
b3ddfa7515
Parse destructured tag annotations as annotations rather than aliases
...
Closes #178
2021-12-26 16:11:29 -06:00
ayazhafiz
0b6d3d2c55
Promote parse tests
2021-12-26 11:35:10 -06:00
ayazhafiz
2cd5bf8c03
Parse "as" aliases into tag/args rather than arbitrary annotations
2021-12-26 08:44:09 -06:00
Joshua Warner
8b58d5cbc7
Switch to always encoding package names / paths as strings
...
This will simplify parsing and make it possible to have a uniform lexer for the language. Previously unquoted package names were allowed to include '-'s, which aren't valid identifiers.
In the future, we'll distinguish local paths from packages in the package-manager by looking for a ".roc" suffix, which should only be present in local paths.
2021-12-23 20:11:14 -08:00
ayazhafiz
6d9a5b6b0d
Actually add the test files
2021-12-23 19:39:54 -06:00
ayazhafiz
46b4a3e6d5
Add test for nested if parsing
...
Closes #169
It seems the above issue was resolved a long time ago but there wasn't a
test for it
2021-12-23 19:39:54 -06:00