Commit 41a5e7c4

41a5e7c4e96bMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 4 files · +2 added · ~2 modified

Description

Merge pull request #274 from ryanseys/rs-node-global-var-target

feat(parse,codegen): support GlobalVariableTargetNode ($a, $b = 1, 2)

Details

Commit
41a5e7c4e96b
Parent
9ffad2a90bcd
Merge parent
3d2e8d1d8754

spinel_codegen.rbmodifiedView file

@@ -25339,6 +25339,12 @@
2533925339 end
2534025340 end
2534125341 end
25342+ if @nd_type[tid] == "GlobalVariableTargetNode"
25343+ # Multi-assign LHS: `$a, $b = 1, 2`. Same storage path as
25344+ # GlobalVariableWriteNode but without an embedded expression --
25345+ # the value is supplied by the caller.
25346+ emit(" " + sanitize_gvar(@nd_name[tid]) + " = " + value_expr + ";")
25347+ end
2534225348 end
2534325349
2534425350 # Handle `a, *b = rhs` / `*a, b = rhs` / `a, *b, c = rhs`.