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
ab54ca27
Unverified
Commit
ab54ca27
authored
Sep 24, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codegen.c: refactor `NODE_WHILE` and `NODE_UNTIL`.
parent
7c6c4ebb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+11
-18
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
ab54ca27
...
...
@@ -2268,10 +2268,7 @@ codegen(codegen_scope *s, node *tree, int val)
if
(
!
val
)
lp
->
reg
=
-
1
;
lp
->
pc0
=
new_label
(
s
);
switch
(
nint
(
tree
->
car
->
car
))
{
case
NODE_TRUE
:
case
NODE_INT
:
case
NODE_STR
:
if
(
true_always
(
tree
->
car
))
{
if
(
nt
==
NODE_UNTIL
)
{
if
(
val
)
{
genop_1
(
s
,
OP_LOADNIL
,
cursp
());
...
...
@@ -2279,9 +2276,8 @@ codegen(codegen_scope *s, node *tree, int val)
}
goto
exit
;
}
break
;
case
NODE_FALSE
:
case
NODE_NIL
:
}
else
if
(
false_always
(
tree
->
car
))
{
if
(
nt
==
NODE_WHILE
)
{
if
(
val
)
{
genop_1
(
s
,
OP_LOADNIL
,
cursp
());
...
...
@@ -2289,8 +2285,7 @@ codegen(codegen_scope *s, node *tree, int val)
}
goto
exit
;
}
break
;
default:
}
codegen
(
s
,
tree
->
car
,
VAL
);
pop
();
if
(
nt
==
NODE_WHILE
)
{
...
...
@@ -2299,8 +2294,6 @@ codegen(codegen_scope *s, node *tree, int val)
else
{
pos
=
genjmp2_0
(
s
,
OP_JMPIF
,
cursp
(),
NOVAL
);
}
break
;
}
lp
->
pc1
=
new_label
(
s
);
codegen
(
s
,
tree
->
cdr
,
NOVAL
);
genjmp
(
s
,
OP_JMP
,
lp
->
pc0
);
...
...
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