mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
ops.h: update OP_ARYDUP instruction and rename to OP_ARYSPLAT.
Transforms the value of a splat inside a return statement (similar to an array). For example, `return *nil` should return `nil.to_a`, while `return *1` should return `[1]`
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ OPCODE(ARRAY, BB) /* R[a] = ary_new(R[a],R[a+1]..R[a+b]) */
|
||||
OPCODE(ARRAY2, BBB) /* R[a] = ary_new(R[b],R[b+1]..R[b+c]) */
|
||||
OPCODE(ARYCAT, B) /* ary_cat(R[a],R[a+1]) */
|
||||
OPCODE(ARYPUSH, BB) /* ary_push(R[a],R[a+1]..R[a+b]) */
|
||||
OPCODE(ARYDUP, B) /* R[a] = ary_dup(R[a]) */
|
||||
OPCODE(ARYSPLAT, B) /* R[a] = ary_splat(R[a]) */
|
||||
OPCODE(AREF, BBB) /* R[a] = R[b][c] */
|
||||
OPCODE(ASET, BBB) /* R[b][c] = R[a] */
|
||||
OPCODE(APOST, BBB) /* *R[a],R[a+1]..R[a+c] = R[a][b..] */
|
||||
|
||||
Reference in New Issue
Block a user