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
d000c72b
Commit
d000c72b
authored
Apr 17, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2072 from take-cheeze/mrb_regexp_p
Add mrb_regexp_p.
parents
1d51d1a0
699964a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
include/mruby/value.h
include/mruby/value.h
+1
-0
mrbgems/mruby-string-utf8/src/string.c
mrbgems/mruby-string-utf8/src/string.c
+1
-1
src/etc.c
src/etc.c
+6
-0
src/string.c
src/string.c
+1
-1
No files found.
include/mruby/value.h
View file @
d000c72b
...
...
@@ -339,6 +339,7 @@ mrb_float_value(struct mrb_state *mrb, mrb_float f)
#define mrb_hash_p(o) (mrb_type(o) == MRB_TT_HASH)
#define mrb_cptr_p(o) (mrb_type(o) == MRB_TT_CPTR)
#define mrb_test(o) mrb_bool(o)
mrb_bool
mrb_regexp_p
(
struct
mrb_state
*
,
mrb_value
);
#define MRB_OBJECT_HEADER \
enum mrb_vtype tt:8;\
...
...
mrbgems/mruby-string-utf8/src/string.c
View file @
d000c72b
...
...
@@ -65,7 +65,7 @@ noregexp(mrb_state *mrb, mrb_value self)
static
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
if
(
!
memcmp
(
mrb_obj_classname
(
mrb
,
obj
),
REGEXP_CLASS
,
sizeof
(
REGEXP_CLASS
)
-
1
))
{
if
(
mrb_regexp_p
(
mrb
,
obj
))
{
noregexp
(
mrb
,
obj
);
}
}
...
...
src/etc.c
View file @
d000c72b
...
...
@@ -8,6 +8,7 @@
#include "mruby/string.h"
#include "mruby/data.h"
#include "mruby/class.h"
#include "mruby/re.h"
struct
RData
*
mrb_data_object_alloc
(
mrb_state
*
mrb
,
struct
RClass
*
klass
,
void
*
ptr
,
const
mrb_data_type
*
type
)
...
...
@@ -176,3 +177,8 @@ mrb_cptr_value(mrb_state *mrb, void *p)
}
#endif
/* MRB_WORD_BOXING */
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
));
}
src/string.c
View file @
d000c72b
...
...
@@ -717,7 +717,7 @@ noregexp(mrb_state *mrb, mrb_value self)
static
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
if
(
!
memcmp
(
mrb_obj_classname
(
mrb
,
obj
),
REGEXP_CLASS
,
sizeof
(
REGEXP_CLASS
)
-
1
))
{
if
(
mrb_regexp_p
(
mrb
,
obj
))
{
noregexp
(
mrb
,
obj
);
}
}
...
...
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