Commit graph

48 commits

Author SHA1 Message Date
hrishisd
cb98c45e88
Remove deprecated string interpolation syntax 2024-10-08 16:31:22 -04:00
Agus Zubiaga
3eadc03e28
Add failing test for multiline params 2024-09-20 16:19:56 -03:00
Agus Zubiaga
519ff56a85
Create can::module::ModuleParams for convenience 2024-08-17 13:10:37 -03:00
Agus Zubiaga
717463079a
Add module params to module cache 2024-07-02 04:10:45 -03:00
Agus Zubiaga
3a1d3d4ddb
Reuse record destructure can for module params 2024-07-02 04:10:45 -03:00
JRI98
f4551978ce
Handle multi pattern unbound list rest variables 2024-06-21 17:01:49 +01:00
Agus Zubiaga
a8a829aadd
Merge branch 'main' into inline-imports 2024-04-28 00:11:29 -03:00
Luke Boswell
db4607125b
remove suffixed from Pattern 2024-04-28 08:47:08 +10: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
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -03:00
Luke Boswell
0143035dc0
cleanup, improve docs 2024-04-14 13:45:06 +10:00
Luke Boswell
3c3e523b45
add suffixed to Identifer and QualifiedIdentifier 2024-04-14 13:45:00 +10:00
Luke Boswell
42fdcb7ff1
Make unit assignment optional for suffixed defs 2024-04-14 13:44:59 +10:00
Agus Zubiaga
002493e32c
Load and can ingested file imports
Moves handling of ingested file imports from load to can, so that they
can be properly introduced in the scope they appear.

Example:

  import "input.txt" as input : Str

  image =
      import "image.png" as bytes : List U8
      # `bytes` is only available under `image`
      decodePng bytes

  ...
2024-01-20 08:43:40 -03:00
Agus Zubiaga
7b3317dbb6
Update unused warnings for inline imports
Now that imports can be limited to smaller scopes than the entire module,
unused import warnings need to work like unused def warnings.

This commit moves unused import warnings discovery and reporting from load
to canonicalization where we can track their usage per scope.

This also fixes a longstanding bug where unused exposed names from an import
were not reported if they were only used in a qualified manner.
2024-01-20 08:43:36 -03:00
Richard Feldman
af8e9c7292
Parse deprecated interpolation syntax differently 2024-01-06 21:49:00 -05:00
Richard Feldman
2da41be29f
Merge remote-tracking branch 'origin/main' into abilities-syntax 2023-08-10 20:36:01 -04:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Bryce Miller
e463ccf4a6
merge main 2023-06-07 20:36:54 -04:00
Ajai Nelson
2e5fef5231
Improve error messages involving ignored variables
Fix #3987
2023-06-06 19:46:15 -04:00
Bryce Miller
cb08225bf0
| -> where 2023-06-05 20:19:00 -04:00
Bryce Miller
dbc0204532
abilities syntax has -> implements 2023-05-24 21:30:16 -04:00
Anton-4
c6cf0b4ebe
merge fixes 2023-04-22 18:15:06 +02:00
Anton-4
937722c462
Merge branch 'main' of github.com:roc-lang/roc into rust_version_upgrade 2023-04-22 17:14:01 +02:00
Anton-4
e784baccce
rust update, nix update, clippy fixes 2023-04-22 14:51:01 +02:00
Folkert
4cd8f0a056 clippy --fix fixes 2023-04-21 12:05:51 +02:00
Ayaz Hafiz
f0b017b807
Correct what destructures are exhaustive 2023-04-10 15:43:02 -05:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples 2023-02-07 18:54:50 -08:00
Richard Feldman
ab7de647e4
Merge pull request #4863 from joshuawarner32/better-scalar-literals
Improve parsing of scalar literals
2023-01-09 11:42:44 -05:00
Folkert
c2ddeb0de0
fix and test as pattern type inference 2023-01-08 16:40:03 +01:00
Joshua Warner
94070e8ba6
Improve parsing of scalar literals
* Unify parsing of string literals and scalar literals, to (e.g.) ensure escapes are handled uniformly. Notably, this makes unicode escapes valid in scalar literals.
* Add a variety of custom error messages about specific failure cases of parsing string/scalar literals. For example, if we're expecting a string (e.g. a package name in the header) and the user tried using single quotes, give a clear message about that.
* Fix formatting of unicode escapes (they previously used {}, now correctly use () to match roc strings)
2023-01-07 15:12:52 -08:00
Folkert
2e27746413
can for list .. as 2022-12-31 16:00:40 +01:00
Folkert
905341d849
can for normal (no-list) as 2022-12-31 15:46:11 +01:00
Folkert
aff70bb6bd
refactor PatternAs 2022-12-30 18:22:10 +01:00
Folkert
e9196f3c0b
parse and format pattern as 2022-12-30 17:50:17 +01:00
Joshua Warner
ca5d084497
Implement tuple pattern parsing
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00
Ayaz Hafiz
ae71c7efe2
Decision tree compilation of list patterns 2022-11-01 15:22:31 -05:00
Ayaz Hafiz
b0a8b85de3
Canonicalization of list patterns 2022-10-31 17:04:47 -05:00
Ayaz Hafiz
4d35ab9957
Parse list patterns 2022-10-26 17:03:22 -05:00
Ayaz Hafiz
619cd2f629
Infer ranged number for chars in patterns 2022-10-05 17:28:01 -05:00
Ayaz Hafiz
41eb3ad9a4
Separate ability members and their specializations in reference checking 2022-07-29 08:43:19 -04:00
Ayaz Hafiz
75ce40c67d
Make sure ability defs that are possibly recursive are marked as such 2022-07-25 10:52:55 -04:00
Ayaz Hafiz
beccc92c87
Support underscores in assignment patterns 2022-07-24 16:11:03 -04:00
Ayaz Hafiz
4839c1f1ce
Clippy doesn't like stack spills. Sorry clippy! 2022-07-21 12:26:42 -04:00
Ayaz Hafiz
bf8fc0d0de
Permit binding variables multiple itmes in when branches 2022-07-21 11:06:40 -04:00
Ayaz Hafiz
666becad87
Clippy 2022-07-19 08:14:12 -04:00
Ayaz Hafiz
96b32c36cb
Introdue ability member names before other value names 2022-07-18 17:55:01 -04:00
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00
Renamed from compiler/can/src/pattern.rs (Browse further)