Phase 25.1a: selfhost builder hotfix (fn rename, docs)
This commit is contained in:
@ -82,11 +82,17 @@ pub extern "C" fn nyash_string_charcode_at_h_export(handle: i64, idx: i64) -> i6
|
||||
// Exported as: nyash.env.argv_get() -> i64 (ArrayBox handle)
|
||||
#[export_name = "nyash.env.argv_get"]
|
||||
pub extern "C" fn nyash_env_argv_get() -> i64 {
|
||||
use nyash_rust::{box_trait::{NyashBox, StringBox}, boxes::array::ArrayBox, runtime::host_handles as handles};
|
||||
use nyash_rust::{
|
||||
box_trait::{NyashBox, StringBox},
|
||||
boxes::array::ArrayBox,
|
||||
runtime::host_handles as handles,
|
||||
};
|
||||
let mut arr = ArrayBox::new();
|
||||
// Skip argv[0] (program name), collect the rest
|
||||
for (i, a) in std::env::args().enumerate() {
|
||||
if i == 0 { continue; }
|
||||
if i == 0 {
|
||||
continue;
|
||||
}
|
||||
let sb: Box<dyn NyashBox> = Box::new(StringBox::new(a));
|
||||
let _ = arr.push(sb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user