Commit 957b9814

957b98143ceeMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 7 months ago · 1 file · ~1 modified

Description

feat: add String#concat with multiple arguments

Appends each argument in sequence to a mutable_str receiver. Previously << handled single-argument case; now concat(a, b, c) is supported as a mutating multi-append operation.

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
957b98143cee
Parent
525a45c6fb15

spinel_codegen.rbmodifiedView file

@@ -14757,6 +14757,20 @@
1475714757 emit(" sp_" + pfx + "_push(" + rc + ", sp_" + pfx + "_get(" + arg + ", " + tmp + "));")
1475814758 return 1
1475914759 end
14760+ if rt == "mutable_str"
14761+ @needs_mutable_str = 1
14762+ rc = compile_expr(recv)
14763+ args_id = @nd_arguments[nid]
14764+ if args_id >= 0
14765+ aargs = get_args(args_id)
14766+ ak = 0
14767+ while ak < aargs.length
14768+ emit(" sp_String_append(" + rc + ", " + compile_expr(aargs[ak]) + ");")
14769+ ak = ak + 1
14770+ end
14771+ end
14772+ return 1
14773+ end
1476014774 end
1476114775 end
1476214776