Commit graph

383 commits

Author SHA1 Message Date
Anton-4
e0cefe4d41
add licenses subcommand (#7787)
* added licenses subcommand

* fmt

* fix nix legal_details inclusion

* zig fmt

* fix tests
2025-05-17 10:30:41 +02:00
Anton-4
a72e3e2a1f
change roc build to build only if check passes (#7784)
change roc build to build if checks
2025-05-12 19:03:21 +02:00
Anton-4
a27feb309a
Remove run anyway tip (#7782) 2025-05-12 17:51:58 +02:00
Anton-4
e89bb6eb50
Fix dev exit code #7767 (#7768)
* Fix dev exit code #7767

* fix nix+clippy
2025-04-29 20:25:15 +02:00
Joshua Warner
6d22c4dd7c
Several migration fixes and make some zig parser improvements based on migrated code in the wild (#7716) 2025-04-08 13:46:44 +02:00
snobee
46736ccaea
Handle errors in generated type annotations 2025-01-27 13:50:53 -08:00
snobee
84f9f35835
Move imports to top of file 2025-01-21 17:11:52 -08:00
snobee
bbe2d7c46f
Remove references to Task and CalledVia::BangSuffix 2025-01-15 21:58:48 -08:00
snobee
406cc6c5e9
Merge remote-tracking branch 'upstream' into annotate-type-signatures 2025-01-15 21:15:32 -08:00
snobee
c519ab7ee1
Stop annotating recursion tags 2025-01-15 20:57:00 -08:00
snobee
1ec619f4f0
Remove duplicated Loc::byte_range() 2025-01-15 20:56:09 -08:00
snobee
78ba0ca701
Use internal_error! instead of assert_debug! 2025-01-15 20:50:50 -08:00
Sam Mohr
eb1b5ffa26
Move to new interpolation syntax 2025-01-10 10:29:20 -08:00
Luke Boswell
7e55990c55
try remove new unwrap 2025-01-08 14:07:53 +11:00
Luke Boswell
9c527f890f
enable --root-dir for roc docs 2025-01-08 13:43:42 +11:00
Anthony Bullard
3b0db07fa1
PNC for Patterns, stabilize formatting 2025-01-02 17:57:15 -06:00
Anthony Bullard
389cc940e0
Git rid of MigrationFlags constructor 2025-01-02 16:49:08 -06:00
Anthony Bullard
af39ce57fb
Parens and Commas application syntax 2025-01-02 16:49:08 -06:00
Jakub Konka
d063d18795
cli: check for FLAG_VERBOSE in each command rather than in build(..) 2024-12-31 11:58:17 +01:00
Jakub Konka
4764b23282
cli: add --verbose flag to CMD_BUILD 2024-12-31 11:57:59 +01:00
Jakub Konka
2624def4cd linker: if support is WIP, use surgical only if explicit flag 2024-12-30 16:27:58 +01:00
Jakub Konka
a4165b3642 linker: introduce SupportLevel to designate completeness
If a linker is `SupportLevel::Full` it can safely be used as a
substitute for the legacy linker. If on the other hand, it's
`SupportLevel::None` then only legacy linker is a viable option.
The third new option is `SupportLevel::Wip` which will enable
surgical linker warning the user that it is a work-in-progress,
your mileage may vary, a lot.
2024-12-30 16:27:50 +01:00
snobee
6313461217
Add tests for automatic annotation 2024-12-13 20:46:38 -08:00
snobee
9f67c79ac0
Add format annotate subcommand 2024-12-13 20:46:28 -08:00
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