Commit graph

359 commits

Author SHA1 Message Date
Norman Jäckel
7cbea2f8fd
Add missing newline to roc check command. 2024-12-14 01:30:11 +01:00
faldor20
81f2095e61
basic working
compiling, but still missing positions from expression errors
2024-12-12 20:54:25 +10:00
Brendan Hansknecht
37c6330c6f
cleanup when expects are run 2024-12-11 15:15:46 -08:00
Brendan Hansknecht
8068fa6d1b
still run in BinaryDev mode with roc main.roc for expect messages 2024-12-11 14:56:12 -08:00
Brendan Hansknecht
76cb2b09cd
Stop ignoring --optimize in roc --optimize main.roc
This is just inconvenient and does not make our api better.
Leads to users thinking that roc does not optimize well.
This also allows `roc dev --optimize` (which is the exact same as `roc --optimize`).
If a user wants to do that, it should be fine.

This will all eventually be replaced by the larger cli rewrite.
2024-12-10 08:51:28 -08:00
Sam Mohr
01f4d4f3da
Merge branch 'main' into cleanup_unused 2024-12-08 10:14:47 -08:00
Sam Mohr
193c23bac8
Merge pull request #7296 from smores56/proper-try-keyword
Proper `try` keyword
2024-12-05 01:38:22 -08:00
JRI98
90f517712a
Remove unused code 2024-12-05 09:18:52 +00:00
Joshua Warner
120e9be550
Move MigrationFlags from an argument on format* to a field on Buf
That has a few advantages:

* We avoid a bunch of extra parameter-passing "noise", since the vast majority of formatting code doesn't need to care about this setting beyond just passing it to nested format calls.
* It aligns really well with the "global" nature of this setting, and makes it impossible to have bugs where e.g. one callsite forgets to pass the correct value to it's children - which would lead to parts of the tree not being migrated. If this is truly a global setting on Buf, that simply can't happen.
2024-12-04 17:57:31 -08:00
Anton-4
7c1dffb777
minor improvements 2024-12-04 14:32:38 +01:00
Sam Mohr
eedade8e81
Initial working version of proper try keyword 2024-12-04 02:31:59 -08:00
Anthony Bullard
a2083cec30
Parsing support for snake_case identifiers
In this initial commit, I have done the following:

- Added unit tests to roc_parse's ident.rs file to cover at least the
  simplest Ident enum cases (Tag, OpaqueRef, and simple Access)
- Added '_' as a valid "rest" character in both uppercase and lowercase
  identifier parts
- Updated the test_syntax snapshots appropriately

There is still a lot left to do here. Such as:

- Do we want to allow multiple '_'s to parse successfully?
- Handle qualified access
- Handle accessor functions
- Handle record update functions
- Remove the UnderscoreInMiddle case from BadIdent
- Write unit tests for Malformed Idents

I am not a "Rustacean" by any means, but have been through the Book in
years past.  Any feedback on the way I wrote the tests or any other part
of the implementation would be very appreciated.
2024-12-03 20:50:47 -06:00
Luke Boswell
0804758895
Merge pull request #6967 from jfkonecn/test-mulitple-files
Roc test can now support multiple files
2024-11-15 07:10:55 +11:00
Luke Boswell
8a566dc339
WIP 2024-11-11 10:22:58 +11:00
John Konecny
4e50795a8b
Can now test multiple files 2024-11-05 08:33:14 -05:00
Sam Mohr
ca762127e5
Fix formatting and clippy errors 2024-10-24 23:11:20 -07:00
Luke Boswell
d0ee040421
make clippy happy 2024-10-24 11:31:15 +11:00
Luke Boswell
926014518f
Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-10-24 10:21:08 +11:00
Jasper Woudenberg
ad555297cf
Set argv[0] to .roc file passed to 'roc run'
When we run `roc run <file>` or `roc <file>` then Roc will compile a
binary and run it. Before this commit we would set the path to the
compiled binary as argv[0]. This commit changes the behavior to make
argv[0] in the binary correspond to the roc file being ran.

This benefits the use of roc scripts that make use of a shebang:

    #!/usr/bin/env roc

With this change such scripts will be able to read the path to
themselves out of ARGV. This trick is commonly used for instance by bash
scripts in order to access files relative to the script itself.
2024-10-21 21:54:46 +02:00
Anton-4
e73484d282
improve names
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-10-15 12:53:56 +02:00
David Edwards
94ad57dcfa
Read file line by line rather than all at once 2024-10-13 21:33:41 +01:00
David Edwards
13ffa9b9db
Initial Sketch of roc check on Markdown
This commit alters `roc check` to be able to run on Markdown files. The overall flow is:
 - check if the file has a `.md` extension
  - if it does extract any fenced code blocks marked as Roc
  - write those blocks to temp files
  - run `roc check` sequentially on every temp file
  - print out the results of `roc check`
  - exit early if any individual `roc check` has non-zero exit status
 - if the file does not have `.md` extension proceed as before
2024-10-09 21:13:45 +01:00
Luke Boswell
e3afeaa7ff
WIP Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-10-09 09:21:46 +11:00
Omar Jatoi
3f318e2235
update existing calls to roc_cache_dir()
using `roc_cache_packages_dir()` instead, which will return "~/.cache/roc/packages", which was the existing functionality, but `roc_cache_dir()` will now return "~/.cache/roc"
2024-10-03 12:52:52 -04:00
Hannes
058ef106af Add commit information to roc versions built from source 2024-09-25 21:12:46 +08:00
Aurélien Geron
b57258f5cb
Remove a couple remaining references to pf.Task 2024-09-11 15:39:26 +12:00
Sam Mohr
aadc74a37b
Merge branch 'main' into repl-no-color-no-header-flags 2024-09-06 15:52:18 -07:00
Luke Boswell
beb2dcbc84
remove unneeded basic-cli reference in formatting test 2024-09-04 21:26:37 +10:00
Anton-4
f89f2e8ea7
fix #6987
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-09-03 20:43:25 +02:00
Luke Boswell
012a2fc63f
Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-09-03 20:35:39 +10:00
Anton-4
e7a44430fd
update to basic cli 15 2024-08-31 14:30:07 +02:00
jamin-eisenberg
d9db14c3d7
Make whitespace uniform 2024-08-28 18:15:24 -04:00
jamin-eisenberg
7429f8a970
Initial attempt (failing tests?) 2024-08-28 18:15:23 -04:00
Anton-4
7938e4bdc8
basic-cli 0.15, test fixes 2024-08-28 18:39:15 +02:00
Anton-4
44b8abdead
update to basic-cli 0.14 2024-08-23 15:50:05 +02:00
Luke Boswell
767ec7af84
cli run tests passing on macos 2024-08-16 17:59:53 +10:00
Luke Boswell
9ecb209f73
add suppress warning flag, remove test test_roc_app_slim 2024-08-16 11:29:39 +10:00
Sam Mohr
550baded7f
Merge branch 'main' into rebuild-platform 2024-08-14 19:39:30 -07:00
Joshua Warner
2d9aa00771
Rename RemoveSpaces->Normalize 2024-08-12 23:05:55 -07:00
Luke Boswell
3ebff4348f
Merge pull request #6979 from roc-lang/fix-target-arg-unknown
make target an argument for preprocess-host
2024-08-12 17:21:26 +10:00
Joshua Warner
0abea91796
Rename Full -> FullAst 2024-08-10 16:06:01 -07:00
Anton-4
439ebcddce
make target an argument 2024-08-10 14:31:29 +02:00
Joshua Warner
d25c048d48
Move Full from fmt to parse and reorganize confusingly-named Module ast type 2024-08-07 23:01:49 -07:00
Joshua Warner
4f32f43048
Implement block / indent based parsing
... and enforce that defs can only occur in blocks (or, inside parenthesized expressions)
2024-07-27 13:34:16 -07:00
Anton-4
3a36d84c45
update to basic-cli 0.12 2024-07-10 20:07:03 +02:00
Luke Boswell
f515311915
clippy fix 2024-07-09 15:47:56 +10:00
Luke Boswell
287d00df85
remove gen_stub_lib 2024-07-09 15:24:24 +10:00
Luke Boswell
85447ec2cc
replace stray strings with impl on Target 2024-07-09 14:39:36 +10:00
Luke Boswell
dc0902bc92
WIP
WIP

WIP

WIP

ignore some cli tests that are going to move

try fix for linux valgrind tests

try a legacy host for valgrind

fix roc_glue tests
2024-07-09 13:48:09 +10:00
Richard Feldman
595695af23
Merge pull request #6869 from roc-lang/fs
Add no_std fs
2024-07-07 18:47:24 -04:00