mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
cli_run no macro re-write
This commit is contained in:
parent
1d9a751606
commit
d5dbee57d9
8 changed files with 605 additions and 715 deletions
File diff suppressed because it is too large
Load diff
|
@ -16,7 +16,7 @@ name = "host"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
roc_std = { path = "../../../crates/roc_std" }
|
roc_std = { path = "../../../../crates/roc_std" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -373,19 +373,17 @@ pub fn cli_testing_dir(dir_name: &str) -> PathBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[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();
|
let mut path = root_dir();
|
||||||
|
|
||||||
// Descend into examples/{dir_name}
|
|
||||||
path.push("examples");
|
|
||||||
path.extend(dir_name.split("/")); // Make slashes cross-target
|
path.extend(dir_name.split("/")); // Make slashes cross-target
|
||||||
|
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn example_file(dir_name: &str, file_name: &str) -> PathBuf {
|
pub fn file_path_from_root(dir_name: &str, file_name: &str) -> PathBuf {
|
||||||
let mut path = examples_dir(dir_name);
|
let mut path = dir_path_from_root(dir_name);
|
||||||
|
|
||||||
path.push(file_name);
|
path.push(file_name);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ name = "host"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
roc_std = { path = "../../../crates/roc_std" }
|
roc_std = { path = "../../../../crates/roc_std" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
arrayvec = "0.7.2"
|
arrayvec = "0.7.2"
|
||||||
page_size = "0.4.2"
|
page_size = "0.4.2"
|
||||||
|
|
|
@ -127,7 +127,7 @@ pub fn build_glyph_brush(
|
||||||
render_format: wgpu::TextureFormat,
|
render_format: wgpu::TextureFormat,
|
||||||
) -> Result<GlyphBrush<()>, InvalidFont> {
|
) -> Result<GlyphBrush<()>, InvalidFont> {
|
||||||
let inconsolata = FontArc::try_from_slice(include_bytes!(
|
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))
|
Ok(GlyphBrushBuilder::using_font(inconsolata).build(gpu_device, render_format))
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
app "helloWorld"
|
app "helloWorld"
|
||||||
packages { pf: "cli/cli-platform/main.roc" }
|
packages { pf: "cli/cli-platform/main.roc" }
|
||||||
imports [pf.Stdout]
|
imports [pf.Stdout, pf.Program.{ Program }]
|
||||||
provides [main] to pf
|
provides [main] to pf
|
||||||
|
|
||||||
main = Stdout.line "Hello, World!"
|
main = Program.noArgs mainTask
|
||||||
|
|
||||||
|
mainTask =
|
||||||
|
Stdout.line "Hello, World!"
|
||||||
|
|> Program.exit 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue