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.
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.
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.
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.
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.
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
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"