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
940eb786
Commit
940eb786
authored
Nov 27, 2012
by
skandhas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Module#module_eval
parent
2ea245db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
src/class.c
src/class.c
+16
-0
No files found.
src/class.c
View file @
940eb786
...
...
@@ -848,6 +848,21 @@ mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod)
return
class_instance_method_list
(
mrb
,
argc
,
argv
,
c
,
0
);
}
mrb_value
mrb_yield_internal
(
mrb_state
*
mrb
,
mrb_value
b
,
int
argc
,
mrb_value
*
argv
,
mrb_value
self
,
struct
RClass
*
c
);
mrb_value
mrb_mod_module_eval
(
mrb_state
*
mrb
,
mrb_value
mod
)
{
mrb_value
a
,
b
;
struct
RClass
*
c
;
if
(
mrb_get_args
(
mrb
,
"|S&"
,
&
a
,
&
b
)
==
1
)
{
mrb_raise
(
mrb
,
E_NOTIMP_ERROR
,
"module_eval/class_eval with string not implemented"
);
}
c
=
mrb_class_ptr
(
mod
);
return
mrb_yield_internal
(
mrb
,
b
,
0
,
0
,
mod
,
c
);
}
mrb_value
mrb_singleton_class
(
mrb_state
*
mrb
,
mrb_value
v
)
{
...
...
@@ -1507,6 +1522,7 @@ mrb_init_class(mrb_state *mrb)
mrb_define_method
(
mrb
,
mod
,
"included"
,
mrb_bob_init
,
ARGS_REQ
(
1
));
/* 15.2.2.4.29 */
mrb_define_method
(
mrb
,
mod
,
"included_modules"
,
mrb_mod_included_modules
,
ARGS_NONE
());
/* 15.2.2.4.30 */
mrb_define_method
(
mrb
,
mod
,
"instance_methods"
,
mrb_mod_instance_methods
,
ARGS_ANY
());
/* 15.2.2.4.33 */
mrb_define_method
(
mrb
,
mod
,
"module_eval"
,
mrb_mod_module_eval
,
ARGS_ANY
());
/* 15.2.2.4.35 */
mrb_define_method
(
mrb
,
mod
,
"to_s"
,
mrb_mod_to_s
,
ARGS_NONE
());
mrb_define_method
(
mrb
,
mod
,
"inspect"
,
mrb_mod_to_s
,
ARGS_NONE
());
...
...
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