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
a5a6b511
Commit
a5a6b511
authored
Mar 25, 2019
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use uppercase version of `ctype` macros e.g. `ISSPACE`; fix #4338
parent
1e14afa4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
23 deletions
+23
-23
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+11
-11
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+6
-6
mrbgems/mruby-pack/src/pack.c
mrbgems/mruby-pack/src/pack.c
+3
-3
src/string.c
src/string.c
+3
-3
No files found.
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
View file @
a5a6b511
...
...
@@ -6,6 +6,15 @@
** immediately. It's a REPL...
*/
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/proc.h>
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/string.h>
#include <mruby/variable.h>
#include <mruby/throw.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
...
...
@@ -49,15 +58,6 @@
#define SIGJMP_BUF jmp_buf
#endif
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/proc.h>
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/string.h>
#include <mruby/variable.h>
#include <mruby/throw.h>
#ifdef ENABLE_READLINE
static
const
char
history_file_name
[]
=
".mirb_history"
;
...
...
@@ -373,7 +373,7 @@ check_keyword(const char *buf, const char *word)
size_t
len
=
strlen
(
word
);
/* skip preceding spaces */
while
(
*
p
&&
isspace
((
unsigned
char
)
*
p
))
{
while
(
*
p
&&
ISSPACE
(
*
p
))
{
p
++
;
}
/* check keyword */
...
...
@@ -383,7 +383,7 @@ check_keyword(const char *buf, const char *word)
p
+=
len
;
/* skip trailing spaces */
while
(
*
p
)
{
if
(
!
isspace
((
unsigned
char
)
*
p
))
return
0
;
if
(
!
ISSPACE
(
*
p
))
return
0
;
p
++
;
}
return
1
;
...
...
mrbgems/mruby-compiler/core/parse.y
View file @
a5a6b511
...
...
@@ -4888,10 +4888,10 @@ parser_yylex(parser_state *p)
}
newtok(p);
/* need support UTF-8 if configured */
if ((
isalnum
(c) || c == '_')) {
if ((
ISALNUM
(c) || c == '_')) {
int c2 = nextc(p);
pushback(p, c2);
if ((
isalnum
(c2) || c2 == '_')) {
if ((
ISALNUM
(c2) || c2 == '_')) {
goto ternary;
}
}
...
...
@@ -5459,7 +5459,7 @@ parser_yylex(parser_state *p)
}
else {
term = nextc(p);
if (
isalnum
(term)) {
if (
ISALNUM
(term)) {
yyerror(p, "unknown type of %string");
return 0;
}
...
...
@@ -5603,7 +5603,7 @@ parser_yylex(parser_state *p)
do {
tokadd(p, c);
c = nextc(p);
} while (c >= 0 &&
isdigit
(c));
} while (c >= 0 &&
ISDIGIT
(c));
pushback(p, c);
if (last_state == EXPR_FNAME) goto gvar;
tokfix(p);
...
...
@@ -5645,7 +5645,7 @@ parser_yylex(parser_state *p)
}
return 0;
}
else if (
isdigit
(c)) {
else if (
ISDIGIT
(c)) {
if (p->tidx == 1) {
yyerror_i(p, "'@%c' is not allowed as an instance variable name", c);
}
...
...
@@ -5802,7 +5802,7 @@ parser_yylex(parser_state *p)
mrb_sym ident = intern_cstr(tok(p));
pylval.id = ident;
if (last_state != EXPR_DOT &&
islower
(tok(p)[0]) && local_var_p(p, ident)) {
if (last_state != EXPR_DOT &&
ISLOWER
(tok(p)[0]) && local_var_p(p, ident)) {
p->lstate = EXPR_END;
}
}
...
...
mrbgems/mruby-pack/src/pack.c
View file @
a5a6b511
...
...
@@ -627,7 +627,7 @@ unpack_a(mrb_state *mrb, const void *src, int slen, mrb_value ary, long count, u
}
}
else
if
(
!
(
flags
&
PACK_FLAG_a
))
{
/* "A" */
while
(
copylen
>
0
&&
(
sptr
[
copylen
-
1
]
==
'\0'
||
isspace
(
sptr
[
copylen
-
1
])))
{
while
(
copylen
>
0
&&
(
sptr
[
copylen
-
1
]
==
'\0'
||
ISSPACE
(
sptr
[
copylen
-
1
])))
{
copylen
--
;
}
}
...
...
@@ -1072,9 +1072,9 @@ alias:
/* read suffix [0-9*_!<>] */
while
(
tmpl
->
idx
<
tlen
)
{
ch
=
tptr
[
tmpl
->
idx
++
];
if
(
isdigit
(
ch
))
{
if
(
ISDIGIT
(
ch
))
{
count
=
ch
-
'0'
;
while
(
tmpl
->
idx
<
tlen
&&
isdigit
(
tptr
[
tmpl
->
idx
]))
{
while
(
tmpl
->
idx
<
tlen
&&
ISDIGIT
(
tptr
[
tmpl
->
idx
]))
{
count
=
count
*
10
+
(
tptr
[
tmpl
->
idx
++
]
-
'0'
);
if
(
count
<
0
)
{
mrb_raise
(
mrb
,
E_RUNTIME_ERROR
,
"too big template length"
);
...
...
src/string.c
View file @
a5a6b511
...
...
@@ -2844,7 +2844,7 @@ mrb_float_read(const char *string, char **endPtr)
*/
p
=
string
;
while
(
isspace
(
*
p
))
{
while
(
ISSPACE
(
*
p
))
{
p
+=
1
;
}
if
(
*
p
==
'-'
)
{
...
...
@@ -2867,7 +2867,7 @@ mrb_float_read(const char *string, char **endPtr)
for
(
mantSize
=
0
;
;
mantSize
+=
1
)
{
c
=
*
p
;
if
(
!
isdigit
(
c
))
{
if
(
!
ISDIGIT
(
c
))
{
if
((
c
!=
'.'
)
||
(
decPt
>=
0
))
{
break
;
}
...
...
@@ -2952,7 +2952,7 @@ mrb_float_read(const char *string, char **endPtr)
}
expSign
=
FALSE
;
}
while
(
isdigit
(
*
p
))
{
while
(
ISDIGIT
(
*
p
))
{
exp
=
exp
*
10
+
(
*
p
-
'0'
);
if
(
exp
>
19999
)
{
exp
=
19999
;
...
...
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