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
444e4b79
Commit
444e4b79
authored
Aug 19, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2538 from kkkkkt/refactor-method
refactor mruby method(fix indent. remove temporary value etc)
parents
98a95530
2f1d12c7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
14 deletions
+8
-14
src/array.c
src/array.c
+1
-1
src/codegen.c
src/codegen.c
+2
-2
src/kernel.c
src/kernel.c
+2
-3
src/load.c
src/load.c
+2
-4
src/object.c
src/object.c
+1
-4
No files found.
src/array.c
View file @
444e4b79
...
...
@@ -1104,5 +1104,5 @@ mrb_init_array(mrb_state *mrb)
mrb_define_method
(
mrb
,
a
,
"unshift"
,
mrb_ary_unshift_m
,
MRB_ARGS_ANY
());
/* 15.2.12.5.30 */
mrb_define_method
(
mrb
,
a
,
"__ary_eq"
,
mrb_ary_eq
,
MRB_ARGS_REQ
(
1
));
mrb_define_method
(
mrb
,
a
,
"__ary_cmp"
,
mrb_ary_cmp
,
MRB_ARGS_REQ
(
1
));
mrb_define_method
(
mrb
,
a
,
"__ary_cmp"
,
mrb_ary_cmp
,
MRB_ARGS_REQ
(
1
));
}
src/codegen.c
View file @
444e4b79
...
...
@@ -746,10 +746,10 @@ gen_values(codegen_scope *s, node *t, int val)
codegen
(
s
,
t
->
car
,
VAL
);
pop
();
pop
();
if
(
is_splat
)
{
genop
(
s
,
MKOP_AB
(
OP_ARYCAT
,
cursp
(),
cursp
()
+
1
));
genop
(
s
,
MKOP_AB
(
OP_ARYCAT
,
cursp
(),
cursp
()
+
1
));
}
else
{
genop
(
s
,
MKOP_AB
(
OP_ARYPUSH
,
cursp
(),
cursp
()
+
1
));
genop
(
s
,
MKOP_AB
(
OP_ARYPUSH
,
cursp
(),
cursp
()
+
1
));
}
t
=
t
->
cdr
;
while
(
t
)
{
...
...
src/kernel.c
View file @
444e4b79
...
...
@@ -738,9 +738,8 @@ static mrb_value
mrb_obj_methods
(
mrb_state
*
mrb
,
mrb_bool
recur
,
mrb_value
obj
,
mrb_method_flag_t
flag
)
{
if
(
recur
)
return
mrb_class_instance_method_list
(
mrb
,
recur
,
mrb_class
(
mrb
,
obj
),
0
);
else
return
mrb_obj_singleton_methods
(
mrb
,
recur
,
obj
);
return
mrb_class_instance_method_list
(
mrb
,
recur
,
mrb_class
(
mrb
,
obj
),
0
);
return
mrb_obj_singleton_methods
(
mrb
,
recur
,
obj
);
}
/* 15.3.1.3.31 */
/*
...
...
src/load.c
View file @
444e4b79
...
...
@@ -337,7 +337,7 @@ read_debug_record(mrb_state *mrb, const uint8_t *start, mrb_irep* irep, size_t *
size_t
len
;
int
ret
;
ret
=
read_debug_record
(
mrb
,
bin
,
irep
->
reps
[
i
],
&
len
,
filenames
,
filenames_len
);
ret
=
read_debug_record
(
mrb
,
bin
,
irep
->
reps
[
i
],
&
len
,
filenames
,
filenames_len
);
if
(
ret
!=
MRB_DUMP_OK
)
return
ret
;
bin
+=
len
;
}
...
...
@@ -570,7 +570,6 @@ MRB_API mrb_value
mrb_load_irep_cxt
(
mrb_state
*
mrb
,
const
uint8_t
*
bin
,
mrbc_context
*
c
)
{
mrb_irep
*
irep
=
mrb_read_irep
(
mrb
,
bin
);
mrb_value
val
;
struct
RProc
*
proc
;
if
(
!
irep
)
{
...
...
@@ -580,8 +579,7 @@ mrb_load_irep_cxt(mrb_state *mrb, const uint8_t *bin, mrbc_context *c)
proc
=
mrb_proc_new
(
mrb
,
irep
);
mrb_irep_decref
(
mrb
,
irep
);
if
(
c
&&
c
->
no_exec
)
return
mrb_obj_value
(
proc
);
val
=
mrb_toplevel_run
(
mrb
,
proc
);
return
val
;
return
mrb_toplevel_run
(
mrb
,
proc
);
}
MRB_API
mrb_value
...
...
src/object.c
View file @
444e4b79
...
...
@@ -310,11 +310,8 @@ convert_type(mrb_state *mrb, mrb_value val, const char *tname, const char *metho
if
(
!
mrb_respond_to
(
mrb
,
val
,
m
))
{
if
(
raise
)
{
mrb_raisef
(
mrb
,
E_TYPE_ERROR
,
"can't convert %S into %S"
,
inspect_type
(
mrb
,
val
),
mrb_str_new_cstr
(
mrb
,
tname
));
return
mrb_nil_value
();
}
else
{
return
mrb_nil_value
();
}
return
mrb_nil_value
();
}
return
mrb_funcall_argv
(
mrb
,
val
,
m
,
0
,
0
);
}
...
...
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