P0-1: Map bad-key tags for get/set/delete + smokes; String substring clamp smoke; P0-2: Bridge no‑op(Method) + Gate‑C invalid header smokes; P1: v1 bridge Closure captures appended to argv
This commit is contained in:
18
lang/src/shared/common/common_imports.hako
Normal file
18
lang/src/shared/common/common_imports.hako
Normal file
@ -0,0 +1,18 @@
|
||||
// CommonImportsBox - Unified import utilities for string operations
|
||||
// Consolidates frequently used StringHelpers and StringOps imports
|
||||
|
||||
using "lang/src/shared/common/string_helpers.hako" as StringHelpers
|
||||
using selfhost.shared.common.string_ops as StringOps
|
||||
|
||||
static box CommonImportsBox {
|
||||
// Provides access to common string utilities
|
||||
// Boxes can import this instead of individual modules
|
||||
static helpers() { return StringHelpers }
|
||||
static ops() { return StringOps }
|
||||
|
||||
// Commonly used string operations
|
||||
static read_digits(text, pos) { return StringHelpers.read_digits(text, pos) }
|
||||
static to_i64(digits) { return StringHelpers.to_i64(digits) }
|
||||
static index_of_from(text, pattern, start) { return StringOps.index_of_from(text, pattern, start) }
|
||||
static substring(text, start, end) { return StringOps.substring(text, start, end) }
|
||||
}
|
||||
18
lang/src/shared/common/entry_point_base.hako
Normal file
18
lang/src/shared/common/entry_point_base.hako
Normal file
@ -0,0 +1,18 @@
|
||||
// EntryPointBaseBox - Common entry point for standalone boxes
|
||||
// Eliminates repetitive main(args){ return 0 } boilerplate
|
||||
|
||||
static box EntryPointBaseBox {
|
||||
// Standard entry point implementation
|
||||
// Can be overridden by specific boxes if needed
|
||||
static main(args) {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Entry point with validation
|
||||
static safe_main(args) {
|
||||
if args == null {
|
||||
return 1
|
||||
}
|
||||
return EntryPointBaseBox.main(args)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user