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
5e514c91
Commit
5e514c91
authored
Feb 04, 2016
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache mrb_regexp_p(); ref #980
parent
4344ca0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
include/mruby.h
include/mruby.h
+4
-0
src/etc.c
src/etc.c
+12
-1
No files found.
include/mruby.h
View file @
5e514c91
...
...
@@ -124,9 +124,13 @@ typedef struct {
typedef
void
(
*
mrb_atexit_func
)(
struct
mrb_state
*
);
#define MRB_STATE_NO_REGEXP 1
#define MRB_STATE_REGEXP 2
typedef
struct
mrb_state
{
struct
mrb_jmpbuf
*
jmp
;
uint32_t
flags
;
mrb_allocf
allocf
;
/* memory allocation function */
void
*
allocf_ud
;
/* auxiliary data of allocf */
...
...
src/etc.c
View file @
5e514c91
...
...
@@ -179,7 +179,18 @@ mrb_word_boxing_cptr_value(mrb_state *mrb, void *p)
MRB_API
mrb_bool
mrb_regexp_p
(
mrb_state
*
mrb
,
mrb_value
v
)
{
return
mrb_class_defined
(
mrb
,
REGEXP_CLASS
)
&&
mrb_obj_is_kind_of
(
mrb
,
v
,
mrb_class_get
(
mrb
,
REGEXP_CLASS
));
if
(
mrb
->
flags
&
MRB_STATE_NO_REGEXP
)
{
return
FALSE
;
}
if
((
mrb
->
flags
&
MRB_STATE_REGEXP
)
||
mrb_class_defined
(
mrb
,
REGEXP_CLASS
))
{
mrb
->
flags
|=
MRB_STATE_REGEXP
;
return
mrb_obj_is_kind_of
(
mrb
,
v
,
mrb_class_get
(
mrb
,
REGEXP_CLASS
));
}
else
{
mrb
->
flags
|=
MRB_STATE_REGEXP
;
mrb
->
flags
|=
MRB_STATE_NO_REGEXP
;
}
return
FALSE
;
}
#if defined _MSC_VER && _MSC_VER < 1900
...
...
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