restructure: move el compiler content into lang/

This commit is contained in:
Will Anderson
2026-05-05 01:38:51 -05:00
parent ce68f91a38
commit 1ae68962cf
143 changed files with 0 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// index-of-all.el every byte offset of a substring.
// "abXcdXefX" / "X" -> [2, 5, 8]. Empty list when no matches.
fn run_test() -> String {
let positions: [Int] = str_index_of_all("abXcdXefX", "X")
let n: Int = native_list_len(positions)
let out: String = ""
let i: Int = 0
while i < n {
let p: Int = native_list_get(positions, i)
if i > 0 {
let out = out + ","
}
let out = out + int_to_str(p)
let i = i + 1
}
return out
}
fn main() -> Void {
println(run_test())
}