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
f9f864d4
Commit
f9f864d4
authored
Jun 05, 2014
by
cremno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't (re-)define `ascii_isspace` and `isascii`
`ISSPACE` and `ISASCII` can be used instead.
parent
69da21bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
51 deletions
+5
-51
mrbgems/mruby-string-utf8/src/string.c
mrbgems/mruby-string-utf8/src/string.c
+2
-23
src/parse.y
src/parse.y
+1
-5
src/string.c
src/string.c
+2
-23
No files found.
mrbgems/mruby-string-utf8/src/string.c
View file @
f9f864d4
...
@@ -37,27 +37,6 @@ static char utf8len_codepage_zero[256] =
...
@@ -37,27 +37,6 @@ static char utf8len_codepage_zero[256] =
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
};
};
static
const
char
isspacetable
[
256
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
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static
mrb_int
static
mrb_int
utf8code
(
unsigned
char
*
p
)
utf8code
(
unsigned
char
*
p
)
{
{
...
@@ -593,7 +572,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
...
@@ -593,7 +572,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
int
ai
=
mrb_gc_arena_save
(
mrb
);
int
ai
=
mrb_gc_arena_save
(
mrb
);
c
=
(
unsigned
char
)
*
ptr
++
;
c
=
(
unsigned
char
)
*
ptr
++
;
if
(
skip
)
{
if
(
skip
)
{
if
(
ascii_isspace
(
c
))
{
if
(
ISSPACE
(
c
))
{
beg
=
ptr
-
bptr
;
beg
=
ptr
-
bptr
;
}
}
else
{
else
{
...
@@ -602,7 +581,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
...
@@ -602,7 +581,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
if
(
lim_p
&&
lim
<=
i
)
break
;
if
(
lim_p
&&
lim
<=
i
)
break
;
}
}
}
}
else
if
(
ascii_isspace
(
c
))
{
else
if
(
ISSPACE
(
c
))
{
mrb_ary_push
(
mrb
,
result
,
str_subseq
(
mrb
,
str
,
beg
,
end
-
beg
));
mrb_ary_push
(
mrb
,
result
,
str_subseq
(
mrb
,
str
,
beg
,
end
-
beg
));
mrb_gc_arena_restore
(
mrb
,
ai
);
mrb_gc_arena_restore
(
mrb
,
ai
);
skip
=
1
;
skip
=
1
;
...
...
src/parse.y
View file @
f9f864d4
...
@@ -42,11 +42,7 @@ static void yywarning(parser_state *p, const char *s);
...
@@ -42,11 +42,7 @@ static void yywarning(parser_state *p, const char *s);
static void backref_error(parser_state *p, node *n);
static void backref_error(parser_state *p, node *n);
static void tokadd(parser_state *p, int32_t c);
static void tokadd(parser_state *p, int32_t c);
#ifndef isascii
#define identchar(c) (isalnum(c) || (c) == '_' || !ISASCII(c))
#define isascii(c) (((c) & ~0x7f) == 0)
#endif
#define identchar(c) (isalnum(c) || (c) == '_' || !isascii(c))
typedef unsigned int stack_type;
typedef unsigned int stack_type;
...
...
src/string.c
View file @
f9f864d4
...
@@ -1728,27 +1728,6 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
...
@@ -1728,27 +1728,6 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
return
mrb_nil_value
();
return
mrb_nil_value
();
}
}
static
const
char
isspacetable
[
256
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
#define ascii_isspace(c) isspacetable[(unsigned char)(c)]
/* 15.2.10.5.35 */
/* 15.2.10.5.35 */
/*
/*
...
@@ -1844,7 +1823,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
...
@@ -1844,7 +1823,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
int
ai
=
mrb_gc_arena_save
(
mrb
);
int
ai
=
mrb_gc_arena_save
(
mrb
);
c
=
(
unsigned
char
)
*
ptr
++
;
c
=
(
unsigned
char
)
*
ptr
++
;
if
(
skip
)
{
if
(
skip
)
{
if
(
ascii_isspace
(
c
))
{
if
(
ISSPACE
(
c
))
{
beg
=
ptr
-
bptr
;
beg
=
ptr
-
bptr
;
}
}
else
{
else
{
...
@@ -1853,7 +1832,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
...
@@ -1853,7 +1832,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
if
(
lim_p
&&
lim
<=
i
)
break
;
if
(
lim_p
&&
lim
<=
i
)
break
;
}
}
}
}
else
if
(
ascii_isspace
(
c
))
{
else
if
(
ISSPACE
(
c
))
{
mrb_ary_push
(
mrb
,
result
,
mrb_str_subseq
(
mrb
,
str
,
beg
,
end
-
beg
));
mrb_ary_push
(
mrb
,
result
,
mrb_str_subseq
(
mrb
,
str
,
beg
,
end
-
beg
));
mrb_gc_arena_restore
(
mrb
,
ai
);
mrb_gc_arena_restore
(
mrb
,
ai
);
skip
=
TRUE
;
skip
=
TRUE
;
...
...
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