phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
30
apps/std/string_std.hako
Normal file
30
apps/std/string_std.hako
Normal file
@ -0,0 +1,30 @@
|
||||
// nyashstd.string – P0 scaffold (JIT-only)
|
||||
// NOTE: This is a minimal placeholder to establish file layout and ny_plugins mapping.
|
||||
// Methods are intentionally simple to avoid relying on NyRT intrinsics.
|
||||
|
||||
static box StdString {
|
||||
init { }
|
||||
|
||||
// Return length estimate for ASCII (placeholder: returns input length via naive loop)
|
||||
length(s) {
|
||||
// naive count; parser subset-safe
|
||||
let i = 0
|
||||
// TODO: real iteration when string iteration is available
|
||||
return 0
|
||||
}
|
||||
|
||||
// concat placeholder: return second argument as a stub
|
||||
concat(a, b) { return b }
|
||||
|
||||
// slice placeholder: return input as-is
|
||||
slice(s, begin, end) { return s }
|
||||
|
||||
// equals placeholder: always false for now
|
||||
equals(a, b) { return 0 }
|
||||
|
||||
// indexOf placeholder: not found
|
||||
indexOf(haystack, needle) { return -1 }
|
||||
|
||||
toString(s) { return s }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user