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
ec6c8b2a
Commit
ec6c8b2a
authored
5 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add local variable reordering to `kwargs`; ref #4746
parent
47cdda37
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+12
-1
No files found.
mrbgems/mruby-compiler/core/parse.y
View file @
ec6c8b2a
...
...
@@ -797,6 +797,12 @@ new_args_tail(parser_state *p, node *kws, node *kwrest, mrb_sym blk)
}
for (k = kws; k; k = k->cdr) {
if (k->car->cdr->cdr->car) { // allocate keywords with default
node *lv = k->car->cdr->cdr->car->cdr;
while (lv) {
local_add_f(p, sym(lv->car));
lv = lv->cdr;
}
k->car->cdr->cdr->car = k->car->cdr->cdr->car->car;
local_add_f(p, sym(k->car->cdr->car));
}
}
...
...
@@ -3302,16 +3308,21 @@ f_arglist : '(' f_args rparen
;
f_label : tIDENTIFIER tLABEL_TAG
{
local_nest(p);
}
;
f_kw : f_label arg
{
void_expr_error(p, $2);
$$ = new_kw_arg(p, $1, $2);
$$ = new_kw_arg(p, $1, cons($2, locals_node(p)));
local_unnest(p);
}
| f_label
{
$$ = new_kw_arg(p, $1, 0);
local_unnest(p);
}
;
...
...
This diff is collapsed.
Click to expand it.
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