Commit graph

411 commits

Author SHA1 Message Date
Hannes
97fa6758d0 Rename trimLeft to trimStart and trimRight to trimEnd 2023-06-19 13:17:59 +08:00
Ajai Nelson
2e5fef5231
Improve error messages involving ignored variables
Fix #3987
2023-06-06 19:46:15 -04:00
Ayaz Hafiz
3585d5bb5b
Implement hash for Dec 2023-05-26 11:38:30 -05:00
Brendan Hansknecht
b4c359588e
Seed Dict and Set
This changes Dict and Set to have a compilation depedent seed.
The seed is not exposed to userland in anyway.
This gets a much more DOS resistant Dict and Set with no cost.
2023-05-25 09:55:48 -07:00
Ayaz Hafiz
2f7930dd0f
Implement annotation def for tuple 2023-05-24 13:12:41 -05:00
Agustin Zubiaga
d1feb00170
Track spaces between : and <- in record builders 2023-05-17 11:49:06 -03:00
Agustin Zubiaga
23db4a5e87
Update tests to new record builder syntax 2023-05-17 11:47:34 -03:00
Ayaz
c072eda598
Merge pull request #5415 from agu-z/agu-z/record-builder-syntax
Prevent record builder field names from shadowing other symbols
2023-05-16 12:41:35 -05:00
Agustin Zubiaga
c43ff03e41
Prevent record builder field names from shadowing other symbols 2023-05-16 13:48:41 -03:00
Richard Feldman
922a10db52
Merge pull request #5389 from agu-z/agu-z/record-builder-syntax
Record Builder Syntax
2023-05-13 22:47:03 -04:00
Agustin Zubiaga
71a2990e21 Tip replacing <- with : for static values 2023-05-09 23:37:24 -03:00
Agustin Zubiaga
088193c93b Fix clippy error 2023-05-08 22:18:56 -03:00
Agustin Zubiaga
9c614540a4 Remove unneeded todo 2023-05-08 21:15:38 -03:00
Agustin Zubiaga
d2a57112fd Unapplied record builder error 2023-05-08 20:16:38 -03:00
Agustin Zubiaga
6670fbb1ab Multiple record builder error 2023-05-08 19:26:47 -03:00
Agustin Zubiaga
20f8133b6c Test record builder desugaring 2023-05-08 18:45:25 -03:00
Agustin Zubiaga
627437c65b Handle space/parens around record builders 2023-05-07 21:56:08 -03:00
Agustin Zubiaga
dfa9c29147 Desugar Record Builder 2023-05-07 20:31:47 -03:00
Folkert de Vries
ec21f19826
Merge pull request #5374 from GabrielDertoni/remove-needless-string-alloc
refactor: remove needless string allocation in pretty printer
2023-05-06 00:34:48 +02:00
Gabriel Dertoni
7d0027f428
refactor: remove needles string allocation in pretty printer
Many times, in order to create a `ven_pretty::Doc` containing a text
node, the pattern `alloc.text(format!(...))` would be used. This code
then creates a fresh string that is then used in the `Doc`. However,
many times only a small string is necessary and so the allocation could
be optimized. The `ven_pretty` crate supports this through a `SmallString`
type. Allocating a fresh string with `format!` also moves control away
from the `DocAllocator` which isn't ideal, since it could also handle
the string allocations. So, instead of creating a fresh string, one can
simply call `alloc.as_string(format_args!(...))` and delegate the
allocation to the `DocAllocator` without any loss in expressivity. So,
in order to encorage this pattern, this commit also introduces the
`text!` macro.

In order to find all instances of the code pattern, the following
tree-sitter query was used:

```scm
(call_expression
    function: (field_expression
        field: (field_identifier) @field.name
               (#eq? @field.name "text"))
    arguments: (arguments
        (macro_invocation
            macro: (identifier) @macro.name
            (#eq? @macro.name "format")))) @reference.call
```
2023-05-03 21:28:36 -03:00
Basile Henry
b8aaaaabda Implement builtins for Num.isNan, Num.isInfinite, and Num.isFinite
Closes #5310 and closes #5309
2023-05-03 09:33:28 +01:00
J.Teeuwissen
b8a2ea1bf2
Merge branch 'main' into drop_specialization 2023-04-29 18:31:12 +02:00
Anton-4
ff6ec21a09
Merge pull request #5324 from roc-lang/rust_version_upgrade
WIP Rust version upgrade
2023-04-29 18:01:04 +02:00
Folkert
cf54304cf4
add lowlevel to inc/dec a data pointer 2023-04-28 15:30:23 +02:00
J Teeuwissen
7439ee0c8c
Merge branch 'main' into drop_specialization
Signed-off-by: J Teeuwissen <jelleteeuwissen@hotmail.nl>
2023-04-26 20:26:37 +02:00
Folkert de Vries
8a76937cff
Merge pull request #5322 from jarlah/replace-panic!-with-internal-error!-in-compiler-parse-create
Replace panic! with internal_error! in `compiler/parse` and `compiler/can`
2023-04-26 18:19:06 +02:00
J.Teeuwissen
ed46a1f2cb
lowlevel isUnique 2023-04-26 17:23:10 +02:00
Anton-4
9748e4a4dc
many clippy fixes 2023-04-24 16:21:46 +02:00
Jarl André Hübenthal
8bf888a5e6
chore: replace panic! with internal_error 2023-04-24 10:16:50 +02:00
Folkert
be31bc5c41
add the PtrWrite lowlevel 2023-04-23 15:19:46 +02: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
394495d307 Revert "update size asserts"
This reverts commit 9973d4b8d2.
2023-04-21 13:22:23 +02:00
Folkert
4cd8f0a056 clippy --fix fixes 2023-04-21 12:05:51 +02:00
Ayaz Hafiz
4894587a14
Inline singly-used function 2023-04-12 14:39:50 -05:00
Ayaz Hafiz
d3ab9ab926
Freshly instantiate nested recursion variables under an opaque type 2023-04-12 14:31:19 -05:00
Ayaz Hafiz
f33651bf6a
Correctly instantiate recursion variables under nested aliases
Like we instantiate nested lambda set variables and nested OIOP
variables for aliases, we need to do the same for recursion variables.
2023-04-12 13:59:24 -05:00
Ayaz Hafiz
f0b017b807
Correct what destructures are exhaustive 2023-04-10 15:43:02 -05:00
Brendan Hansknecht
c440b2ca05
Switch to PathBuf to avoid Path turning into a fat pointer. Avoids growing Constraints 2023-04-09 21:14:05 -07:00
Brendan Hansknecht
90f4885f4b
use Arc to avoid ever needing to actually copy the underlying bytes 2023-04-09 14:03:33 -07:00
Brendan Hansknecht
a354860d07
clippy 2023-04-09 14:03:33 -07:00
Brendan Hansknecht
6302a8d4b5
switch from type annotation to type variable 2023-04-09 14:03:33 -07:00
Brendan Hansknecht
8f4945f286
make file loading errors that happen late in compilation still fatal 2023-04-09 14:03:33 -07:00
Brendan Hansknecht
7079361841
add ingested file category for error messages 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
d42aa43b41
add ingest file to can ir and start pipelining it through the compiler 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
7c77f7c2a2
get a basic full pipeline working that will load a file as a string 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
56ed985cc9
pass through correct path and type for ingested file 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
f4411afbbc
get basic wiring of a value through the compiler 2023-04-09 14:03:31 -07:00
Ayaz Hafiz
630a8e32d4
Clippy 2023-04-02 00:32:20 -05:00