Phase 25.1a: selfhost builder hotfix (fn rename, docs)

This commit is contained in:
nyash-codex
2025-11-15 05:42:32 +09:00
parent 8d9bbc40bd
commit 6856922374
40 changed files with 2013 additions and 72 deletions

View File

@ -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);
}