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
db29a25a
Commit
db29a25a
authored
Aug 28, 2014
by
Tatsuhiko Kubo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename functions for avoinding symbol confiliction.
Add prefix(mrb) to noregexp() and regexp_check().
parent
d958aa2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
include/mruby/string.h
include/mruby/string.h
+2
-2
mrbgems/mruby-string-utf8/src/string.c
mrbgems/mruby-string-utf8/src/string.c
+7
-7
src/string.c
src/string.c
+10
-10
No files found.
include/mruby/string.h
View file @
db29a25a
...
...
@@ -107,8 +107,8 @@ mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str);
mrb_value
mrb_str_dump
(
mrb_state
*
mrb
,
mrb_value
str
);
mrb_value
mrb_str_inspect
(
mrb_state
*
mrb
,
mrb_value
str
);
void
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
);
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
);
void
mrb_
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
);
void
mrb_
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
);
/* For backward compatibility */
#define mrb_str_cat2(mrb, str, ptr) mrb_str_cat_cstr(mrb, str, ptr)
...
...
mrbgems/mruby-string-utf8/src/string.c
View file @
db29a25a
...
...
@@ -255,7 +255,7 @@ mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx)
{
mrb_int
idx
;
regexp_check
(
mrb
,
indx
);
mrb_
regexp_check
(
mrb
,
indx
);
switch
(
mrb_type
(
indx
))
{
case
MRB_TT_FIXNUM
:
idx
=
mrb_fixnum
(
indx
);
...
...
@@ -300,7 +300,7 @@ mrb_str_aref_m(mrb_state *mrb, mrb_value str)
argc
=
mrb_get_args
(
mrb
,
"o|o"
,
&
a1
,
&
a2
);
if
(
argc
==
2
)
{
regexp_check
(
mrb
,
a1
);
mrb_
regexp_check
(
mrb
,
a1
);
return
str_substr
(
mrb
,
str
,
mrb_fixnum
(
a1
),
mrb_fixnum
(
a2
));
}
if
(
argc
!=
1
)
{
...
...
@@ -331,7 +331,7 @@ mrb_str_index_m(mrb_state *mrb, mrb_value str)
sub
=
mrb_nil_value
();
}
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
if
(
pos
<
0
)
{
pos
+=
RSTRING_LEN
(
str
);
if
(
pos
<
0
)
{
...
...
@@ -410,7 +410,7 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
if
(
pos
<
0
)
{
pos
+=
len
;
if
(
pos
<
0
)
{
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
return
mrb_nil_value
();
}
}
...
...
@@ -423,7 +423,7 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
else
sub
=
mrb_nil_value
();
}
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
if
(
mrb_type
(
sub
)
==
MRB_TT_FIXNUM
)
{
sub
=
mrb_fixnum_chr
(
mrb
,
sub
);
...
...
@@ -533,7 +533,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
}
}
else
{
noregexp
(
mrb
,
str
);
mrb_
noregexp
(
mrb
,
str
);
}
}
...
...
@@ -603,7 +603,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
beg
=
ptr
-
temp
;
}
else
{
noregexp
(
mrb
,
str
);
mrb_
noregexp
(
mrb
,
str
);
}
if
(
RSTRING_LEN
(
str
)
>
0
&&
(
lim_p
||
RSTRING_LEN
(
str
)
>
beg
||
lim
<
0
))
{
if
(
RSTRING_LEN
(
str
)
==
beg
)
{
...
...
src/string.c
View file @
db29a25a
...
...
@@ -638,16 +638,16 @@ mrb_string_value_ptr(mrb_state *mrb, mrb_value ptr)
}
void
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
mrb_
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_raise
(
mrb
,
E_NOTIMP_ERROR
,
"Regexp class not implemented"
);
}
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
mrb_
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
if
(
mrb_regexp_p
(
mrb
,
obj
))
{
noregexp
(
mrb
,
obj
);
mrb_
noregexp
(
mrb
,
obj
);
}
}
...
...
@@ -737,7 +737,7 @@ mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx)
{
mrb_int
idx
;
regexp_check
(
mrb
,
indx
);
mrb_
regexp_check
(
mrb
,
indx
);
switch
(
mrb_type
(
indx
))
{
case
MRB_TT_FIXNUM
:
idx
=
mrb_fixnum
(
indx
);
...
...
@@ -819,7 +819,7 @@ mrb_str_aref_m(mrb_state *mrb, mrb_value str)
argc
=
mrb_get_args
(
mrb
,
"o|o"
,
&
a1
,
&
a2
);
if
(
argc
==
2
)
{
regexp_check
(
mrb
,
a1
);
mrb_
regexp_check
(
mrb
,
a1
);
return
mrb_str_substr
(
mrb
,
str
,
mrb_fixnum
(
a1
),
mrb_fixnum
(
a2
));
}
if
(
argc
!=
1
)
{
...
...
@@ -1283,7 +1283,7 @@ mrb_str_index_m(mrb_state *mrb, mrb_value str)
else
sub
=
mrb_nil_value
();
}
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
if
(
pos
<
0
)
{
pos
+=
RSTRING_LEN
(
str
);
if
(
pos
<
0
)
{
...
...
@@ -1622,7 +1622,7 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
if
(
pos
<
0
)
{
pos
+=
len
;
if
(
pos
<
0
)
{
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
return
mrb_nil_value
();
}
}
...
...
@@ -1635,7 +1635,7 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
else
sub
=
mrb_nil_value
();
}
regexp_check
(
mrb
,
sub
);
mrb_
regexp_check
(
mrb
,
sub
);
switch
(
mrb_type
(
sub
))
{
case
MRB_TT_FIXNUM
:
{
...
...
@@ -1745,7 +1745,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
}
}
else
{
noregexp
(
mrb
,
str
);
mrb_
noregexp
(
mrb
,
str
);
}
}
...
...
@@ -1814,7 +1814,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
beg
=
ptr
-
temp
;
}
else
{
noregexp
(
mrb
,
str
);
mrb_
noregexp
(
mrb
,
str
);
}
if
(
RSTRING_LEN
(
str
)
>
0
&&
(
lim_p
||
RSTRING_LEN
(
str
)
>
beg
||
lim
<
0
))
{
if
(
RSTRING_LEN
(
str
)
==
beg
)
{
...
...
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