Commit 1ce49240
1ce49240bc2aMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 3 files · +1 added · ~2 modified
Description
codegen: int_array#slice_before / #slice_after with literal int delimiter
Same shape as the slice_when emit added last commit: walk the array and start a new chunk before (slice_before) or after (slice_after) each element matching the supplied value. Only the int-equality literal arg form is supported; regexp / block forms still fall through and can be added per use case.
Fixes #936
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- 1ce49240bc2a
- Parent
- c6b962331cb9
spinel_analyze.rbmodifiedView file
@@ -4477,7 +4477,7 @@
44774477
if mname == "product"44784478
return "int_array_ptr_array"44794479
end4480-
if mname == "slice_when" || mname == "chunk_while"4480+
if mname == "slice_when" || mname == "chunk_while" || mname == "slice_before" || mname == "slice_after"44814481
return "int_array_ptr_array"44824482
end44834483
if mname == "chunk"spinel_codegen.rbmodifiedView file
Loading diff…
test/array_slice_before_after.rbaddedView file
Loading diff…