summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-06-06 12:48:48 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-06-06 12:48:48 +0900
commit232b8b07e4d333129bf4eb83b48a408dcc130a55 (patch)
tree6014e6666183bd613366a1bdca53303c544b9823 /src/parse.y
parentccd871bcca0e55fd08bbe00ad4fd7c380d720780 (diff)
parent71c7d587368cac3101045d8651e64f46a8e1dded (diff)
downloadmruby-232b8b07e4d333129bf4eb83b48a408dcc130a55.tar.gz
mruby-232b8b07e4d333129bf4eb83b48a408dcc130a55.zip
Merge branch 'ascii' of https://github.com/cremno/mruby into cremno-ascii
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/parse.y b/src/parse.y
index 93923aa71..1d4e83cde 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -42,11 +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);
-#ifndef isascii
-#define isascii(c) (((c) & ~0x7f) == 0)
-#endif
-
-#define identchar(c) (isalnum(c) || (c) == '_' || !isascii(c))
+#define identchar(c) (ISALNUM(c) || (c) == '_' || !ISASCII(c))
typedef unsigned int stack_type;
@@ -3911,7 +3907,8 @@ parse_string(parser_state *p)
return tHD_LITERAL_DELIM;
}
}
- } while (ISSPACE(c = nextc(p)));
+ c = nextc(p);
+ } while (ISSPACE(c));
pushback(p, c);
return tLITERAL_DELIM;
}
@@ -4205,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;
@@ -4337,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) {
@@ -5190,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 {