Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
bce75e27
Commit
bce75e27
authored
Nov 22, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
should support recursive mlhs decomposition, e.g. (a,b),c = [1,2],3
parent
b28ec1bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/codegen.c
src/codegen.c
+13
-1
src/parse.y
src/parse.y
+2
-2
No files found.
src/codegen.c
View file @
bce75e27
...
...
@@ -953,6 +953,18 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
}
break
;
case
NODE_MASGN
:
gen_vmassignment
(
s
,
tree
->
car
,
sp
,
val
);
break
;
push
();
gen_call
(
s
,
tree
,
attrsym
(
s
,
sym
(
tree
->
cdr
->
car
)),
sp
,
NOVAL
);
pop
();
if
(
val
)
{
genop_peep
(
s
,
MKOP_AB
(
OP_MOVE
,
cursp
(),
sp
),
val
);
}
break
;
default:
#ifdef ENABLE_STDIO
printf
(
"unknown lhs %d
\n
"
,
type
);
...
...
@@ -1006,7 +1018,7 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
}
}
}
else
{
else
if
(
val
)
{
pop
();
}
}
...
...
src/parse.y
View file @
bce75e27
...
...
@@ -1468,7 +1468,7 @@ mlhs : mlhs_basic
mlhs_inner : mlhs_basic
| tLPAREN mlhs_inner rparen
{
$$ =
list1($2)
;
$$ =
$2
;
}
;
...
...
@@ -1517,7 +1517,7 @@ mlhs_basic : mlhs_list
mlhs_item : mlhs_node
| tLPAREN mlhs_inner rparen
{
$$ =
$2
;
$$ =
new_masgn(p, $2, NULL)
;
}
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment