cli_run no macro re-write

This commit is contained in:
Anton-4 2022-09-27 20:25:28 +02:00
parent 1d9a751606
commit d5dbee57d9
No known key found for this signature in database
GPG key ID: A13F4A6E21141925
8 changed files with 605 additions and 715 deletions

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ name = "host"
path = "src/main.rs"
[dependencies]
roc_std = { path = "../../../crates/roc_std" }
roc_std = { path = "../../../../crates/roc_std" }
libc = "0.2"
[workspace]

File diff suppressed because one or more lines are too long

View file

@ -373,19 +373,17 @@ pub fn cli_testing_dir(dir_name: &str) -> PathBuf {
}
#[allow(dead_code)]
pub fn examples_dir(dir_name: &str) -> PathBuf {
pub fn dir_path_from_root(dir_name: &str) -> PathBuf {
let mut path = root_dir();
// Descend into examples/{dir_name}
path.push("examples");
path.extend(dir_name.split("/")); // Make slashes cross-target
path
}
#[allow(dead_code)]
pub fn example_file(dir_name: &str, file_name: &str) -> PathBuf {
let mut path = examples_dir(dir_name);
pub fn file_path_from_root(dir_name: &str, file_name: &str) -> PathBuf {
let mut path = dir_path_from_root(dir_name);
path.push(file_name);

View file

@ -15,7 +15,7 @@ name = "host"
path = "src/main.rs"
[dependencies]
roc_std = { path = "../../../crates/roc_std" }
roc_std = { path = "../../../../crates/roc_std" }
libc = "0.2"
arrayvec = "0.7.2"
page_size = "0.4.2"

View file

@ -127,7 +127,7 @@ pub fn build_glyph_brush(
render_format: wgpu::TextureFormat,
) -> Result<GlyphBrush<()>, InvalidFont> {
let inconsolata = FontArc::try_from_slice(include_bytes!(
"../../../../../../crates/editor/Inconsolata-Regular.ttf"
"../../../../../../../crates/editor/Inconsolata-Regular.ttf"
))?;
Ok(GlyphBrushBuilder::using_font(inconsolata).build(gpu_device, render_format))

View file

@ -1,6 +1,11 @@
app "helloWorld"
packages { pf: "cli/cli-platform/main.roc" }
imports [pf.Stdout]
imports [pf.Stdout, pf.Program.{ Program }]
provides [main] to pf
main = Stdout.line "Hello, World!"
main = Program.noArgs mainTask
mainTask =
Stdout.line "Hello, World!"
|> Program.exit 0