- restore: lang/src/compiler/** (parser/emit/builder/pipeline_v2) from e917d400 - docs: docs/development/selfhosting/index-operator-hako.md - smokes(hako): tools/smokes/v2/profiles/quick/core/index_operator_hako.sh (opt-in) - smokes(vm): adjust index_operator_vm.sh for semicolon gate + stable error text - rust/parser: allow IndexExpr and assignment LHS=Index; postfix parse LBRACK chain - rust/builder: lower arr/map index to BoxCall get/set; annotate array/map literals; Fail‑Fast for unsupported types - CURRENT_TASK: mark Rust side done; add Hako tasks checklist Note: files disappeared likely due to branch FF to a lineage without lang/src/compiler; no explicit delete commit found. Added anchor checks and suggested CI guard in follow-up.
44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
// map_helpers_box.hako — Pipeline用の軽量ヘルパ(MapBoxの型付き取得)
|
||
|
||
using "lang/src/shared/common/string_helpers.hako" as StringHelpers
|
||
using "lang/src/shared/common/box_helpers.hako" as BoxHelpers
|
||
static box MapHelpersBox {
|
||
_raw_get(m, key) {
|
||
return BoxHelpers.map_get(m, key)
|
||
}
|
||
|
||
_to_i64(v) { return StringHelpers.to_i64(v) }
|
||
|
||
get_str(m, key) {
|
||
local v = me._raw_get(m, key)
|
||
if v == null { return "" }
|
||
if BoxHelpers.is_map(v) == 1 {
|
||
local inner = BoxHelpers.map_get(v, "value")
|
||
if inner != null { return "" + inner }
|
||
}
|
||
return "" + v
|
||
}
|
||
|
||
get_i64(m, key) {
|
||
local v = me._raw_get(m, key)
|
||
return BoxHelpers.value_i64(v)
|
||
}
|
||
|
||
expect_str(m, key) { return me.get_str(m, key) }
|
||
expect_i64(m, key) { return me.get_i64(m, key) }
|
||
|
||
opt_str(m, key, def) {
|
||
local s = me.get_str(m, key)
|
||
if s == null || s == "" { return def }
|
||
return s
|
||
}
|
||
|
||
opt_i64(m, key, def) {
|
||
local n = me.get_i64(m, key)
|
||
if n == null { return def }
|
||
return n
|
||
}
|
||
}
|
||
|
||
static box MapHelpersStub { main(args) { return 0 } }
|