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
end2534025340
end2534125341
end25342+
if @nd_type[tid] == "GlobalVariableTargetNode"25343+
# Multi-assign LHS: `$a, $b = 1, 2`. Same storage path as25344+
# GlobalVariableWriteNode but without an embedded expression --25345+
# the value is supplied by the caller.25346+
emit(" " + sanitize_gvar(@nd_name[tid]) + " = " + value_expr + ";")25347+
end2534225348
end2534325349
2534425350
# Handle `a, *b = rhs` / `*a, b = rhs` / `a, *b, c = rhs`.spinel_parse.cmodifiedView file
Loading diff…
test/global_var_target.rbaddedView file
Loading diff…
test/global_var_target.rb.expectedaddedView file
Loading diff…