diff options
| author | cremno <[email protected]> | 2014-06-05 21:00:47 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2014-06-05 21:00:47 +0200 |
| commit | 1a5841b4b10a0e59446df5235c92e679eb3092ef (patch) | |
| tree | df5a65d6587a68bc25519bad64e90c5614329b90 | |
| parent | f9f864d4dd7f3f4213cabe5f8a4e427a03120461 (diff) | |
| download | mruby-1a5841b4b10a0e59446df5235c92e679eb3092ef.tar.gz mruby-1a5841b4b10a0e59446df5235c92e679eb3092ef.zip | |
use uppercase US-ASCII ctype macros
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 4 | ||||
| -rw-r--r-- | src/parse.y | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index 5c9524161..c742d28fb 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -258,7 +258,7 @@ check_keyword(const char *buf, const char *word) size_t len = strlen(word); /* skip preceding spaces */ - while (*p && isspace(*p)) { + while (*p && ISSPACE(*p)) { p++; } /* check keyword */ @@ -268,7 +268,7 @@ check_keyword(const char *buf, const char *word) p += len; /* skip trailing spaces */ while (*p) { - if (!isspace(*p)) return 0; + if (!ISSPACE(*p)) return 0; p++; } return 1; diff --git a/src/parse.y b/src/parse.y index 1af6e7833..1d4e83cde 100644 --- a/src/parse.y +++ b/src/parse.y @@ -42,7 +42,7 @@ static void yywarning(parser_state *p, const char *s); static void backref_error(parser_state *p, node *n); static void tokadd(parser_state *p, int32_t c); -#define identchar(c) (isalnum(c) || (c) == '_' || !ISASCII(c)) +#define identchar(c) (ISALNUM(c) || (c) == '_' || !ISASCII(c)) typedef unsigned int stack_type; @@ -4202,14 +4202,14 @@ parser_yylex(parser_state *p) static const char end[] = "\n=end"; if (peeks(p, begin)) { c = peekc_n(p, sizeof(begin)-1); - if (c < 0 || isspace(c)) { + if (c < 0 || ISSPACE(c)) { do { if (!skips(p, end)) { yyerror(p, "embedded document meets end of file"); return 0; } c = nextc(p); - } while (!(c < 0 || isspace(c))); + } while (!(c < 0 || ISSPACE(c))); if (c != '\n') skip(p, '\n'); p->lineno++; p->column = 0; @@ -4334,7 +4334,7 @@ parser_yylex(parser_state *p) yyerror(p, "incomplete character syntax"); return 0; } - if (isspace(c)) { + if (ISSPACE(c)) { if (!IS_ARG()) { int c2; switch (c) { @@ -5187,7 +5187,7 @@ parser_yylex(parser_state *p) pushback(p, c); } } - if (result == 0 && isupper((int)(unsigned char)tok(p)[0])) { + if (result == 0 && ISUPPER(tok(p)[0])) { result = tCONSTANT; } else { |
