restore(lang): full lang tree from ff3ef452 (306 files) — compiler, vm, shared, runner, c-abi, etc.\n\n- Restores lang/ directory (files≈306, dirs≈64) as per historical branch with selfhost sources\n- Keeps our recent parser index changes in compiler/* (merged clean by checkout)\n- Unblocks selfhost development and documentation references

This commit is contained in:
nyash-codex
2025-10-31 20:45:46 +09:00
parent dbc285f2b1
commit e5f697eb22
244 changed files with 16915 additions and 47 deletions

View File

@ -0,0 +1,18 @@
// phi_apply_box.hako — PhiApplyBox
// 責務: φ の適用dst レジスタに vin の値をロードして書き込む)
// 非責務: φ のデコードやスキャン(呼び出し元で行う)
using "lang/src/shared/common/string_helpers.hako" as StringHelpers
static box PhiApplyBox {
// 内部: 文字列が整数表現かを緩く判定
_is_numeric_str(s){ if s==null {return 0} return StringHelpers.is_numeric_str(s) }
_str_to_int(s){ return StringHelpers.to_i64(s) }
_load_reg(regs,id){ local v=regs.get(""+id) if v==null {return 0} local s=""+v if me._is_numeric_str(s)==1 { return me._str_to_int(s) } return 0 }
apply(dst, vin, regs) {
if dst == null || vin == null { return }
local vv = me._load_reg(regs, vin)
regs.set(""+dst, vv)
}
}