Commit Graph

136 Commits

Author SHA1 Message Date
Agus Zubiaga
52f84910a7
Support importing local files in the REPL 2024-04-26 23:33:19 -03: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
Anton-4
adf88e7282
change underline color 2024-02-19 13:53:01 +01:00
Anton-4
c6b5e2f8c3
less colors more contrast 2024-02-14 17:20:44 +01:00
Folkert
b0d57587e3
List.get with negative index in repl 2024-01-28 22:21:40 +01:00
Brendan Hansknecht
496cd6710a
fix debug info and add it all to the llvm backend 2023-12-04 12:55:33 -08:00
Richard Feldman
b725a114cf
Remove fancy quote from rockin' roc repl 2023-11-18 22:16:14 -05:00
Folkert
7bcff253be
enable dev backend repl on macos (x86_64 and aarch64) 2023-10-10 15:12:50 +02:00
Richard Feldman
1f396871f9
Simplify repl tips 2023-09-18 15:26:09 -05:00
Richard Feldman
e6b9446755
Move WELCOME_MESSAGE to be cli-specific 2023-09-18 15:26:09 -05:00
Richard Feldman
074401fbdf
Remove the whole #var1 thing 2023-09-17 06:31:51 -04:00
Richard Feldman
f4937e72cc
Try printing #val1 at end of previous line 2023-09-17 01:01:58 -04:00
Folkert
287c893043
fix unused warning on macos 2023-09-14 14:53:44 +02:00
Folkert
2ddf0ce180
disable debugging flag 2023-09-14 14:43:29 +02:00
Folkert
5557fb7e34
repl helper codegen 2023-09-14 14:39:12 +02:00
Folkert
dcdaaf4328
enable dev backend repl 2023-09-14 14:38:31 +02:00
Folkert
5ca3d3bcf1
make llvm tests work again 2023-09-13 20:24:15 +02:00
Brian Carroll
ead3c33eb8
Tweak comments and factoring 2023-09-10 11:28:29 +01:00
Brian Carroll
6a47a99114
formatting & clippy 2023-09-09 16:13:17 +01:00
Brian Carroll
aa0e975845
clippy 2023-09-09 15:03:50 +01:00
Brian Carroll
fc7b831285
remove some more duplicated code (format_output) 2023-09-09 14:45:14 +01:00
Brian Carroll
3923dad203
Remove duplicated code from roc_repl_cli and get tests compiling 2023-09-09 13:01:31 +01:00
Brian Carroll
8f59ee9492
Create a new crate roc_repl_ui for shared CLI/web UI code 2023-09-09 11:55:55 +01:00
Richard Feldman
dbf928bc46
Reorganize ReplState logic for cli/wasm compat 2023-09-08 15:37:16 -04:00
Folkert
7fb4b60b21
move around hostexposedalias logic 2023-08-09 15:09:03 +02:00
Ayaz Hafiz
44c4797d9a
Parameterize program solving on a FunctionKind
This new flag determines whether we should introduce a new kind to
represent lambda sets, or whether lambdas should be erased. The latter
is not yet implemented.
2023-07-12 13:53:50 -05:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
eiei114
bf3f541331
Merge branch 'main' into fix/replace_panic_with_internal_error 2023-06-27 12:48:34 +09:00
eiei114
486558396f
replace panic 2023-06-25 18:13:44 +09:00
eiei114
c1d4a18c00
Revert "replace"
This reverts commit f43e346897.
2023-06-25 17:50:05 +09:00
eiei114
f43e346897
replace 2023-06-25 17:14:02 +09:00
Ayaz Hafiz
41597cbab7
Do not make LayoutInterner mutable 2023-06-17 18:13:03 -05:00
Gabriel Dertoni
a7640bc0ac
fix: repl panic on empty line 2023-04-27 02:01:17 -03:00
Folkert
4cd8f0a056 clippy --fix fixes 2023-04-21 12:05:51 +02:00
Folkert
fe15a2e79c
Merge remote-tracking branch 'origin/main' into glue-getters-rtfeldman 2023-03-08 19:46:00 +01:00
Brendan Hansknecht
f42f61e271
run a toml formatter and then clean it up a bit 2023-03-06 19:47:57 -08:00
Brendan Hansknecht
4a89bee0a5
centralize package versions except for vendor and excluded 2023-03-06 19:29:09 -08:00
Brendan Hansknecht
5485c8a5b0
update to using workspace package spec 2023-03-06 16:36:18 -08:00
Folkert
454f3c603e
give the new exposed symbols to the surgical linker 2023-02-25 19:35:46 +01:00
Ayaz Hafiz
50826d1a83
Inline interners into the layout interner module
I realized that we'll need to make the layout interner more complicated
to support things like recursive pointers pointing to their parents and
to support lambda set layout caching. Since the layout interner is the
only user of intern crate right now anyway, just inline the whole thing.
2023-01-03 14:19:39 -06:00
Ayaz Hafiz
b60d5c0251
Push wrapped layout interners through 2023-01-03 10:51:33 -06:00
Ayaz Hafiz
759f8d86af
Fix lifetime errors due to interner
In the llvm backend, there are the lifetimes `'a` (lifetime of the
global arena) and `'ctx` (lifetime of constructed LLVM values). `'a`
lives longer than `'ctx`, but the compiler didn't enforce this until
the layout interner was introduced, for some reason. We have to make
sure that containers of lifetime `'a` have no `'ctx` references.
2022-12-29 11:38:34 -06:00
Joshua Warner
a046428ce6
Add fuzzing for the formatter and fix bugs
This commit adds fuzzing for the (expr) formatter, with the same invariants that we use for fmt tests:
  * We start with text, which we parse
  * We format the AST, which must succeed
  * We parse back the AST and make sure it's identical igoring whitespace+comments
  * We format the new AST and assert it's equal to the first formatted version ("idempotency")

Interestingly, while a lot of bugs this found were in the formatter, it also found some parsing bugs.

It then fixes a bunch of bugs that fell out:
* Some small oversights in RemoveSpaces
* Make sure `_a` doesn't parse as an inferred type (`_`) followed by an identifier (parsing bug!)
* Call `extract_spaces` on a parsed expr before matching on it, lest it be Expr::SpaceBefore - when parsing aliases
* A few cases where the formatter generated invalid/different code
* Numerous formatting bugs that caused the formatting to not be idempotent

The last point there is worth talking further about. There were several cases where the old code was trying to enforce strong
opinions about how to insert newlines in function types and defs. In both of those cases, it looked like the goals of
(1) idempotency, (2) giving the user some say in the output, and (3) these strong opinions - were often in conflict.

For these cases, I erred on the side of following the user's existing choices about where to put newlines.

We can go back and re-add this strong opinionation later - but this seemed the right approach for now.
2022-12-17 09:52:09 -08:00
Richard Feldman
e3687935a3
Merge remote-tracking branch 'origin/main' into refactor-platform-info 2022-12-09 22:21:25 -05:00
Richard Feldman
63e9f5da8c
Go back to old opt_main_for_host 2022-12-09 22:18:52 -05:00
Folkert
a72556b927
refactor entry point 2022-12-09 15:10:25 +01:00
Richard Feldman
8b463686bc
Propagate multiple entrypoints to alias analysis 2022-12-08 15:31:42 -05:00
Richard Feldman
49f8768271
Parse and format dbg 2022-11-22 21:08:26 -05:00
Joshua Warner
2d9aba2242
Refactor parser methods to not return State as part of ParseError
As previously discovered with #4464, it's easy to accidentally mis-use the State value returned on the Err path.

There were mixed assumptions about what that State represents: (1) the State where the error occurred, or (2) the State at the beginning of the thing we were just parsing.

I fixed this up to always mean (2) - at which point we don't actually need to return the State at all - so it's impossible for further discrepency to creep in.

I also took the liberty to refactor a few more methods to be purely combinator-based, rather than calling `parse` directly.
2022-11-18 19:52:23 -05:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00