mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y (nextc0): small refactoring.
This commit is contained in:
@@ -4257,22 +4257,20 @@ static mrb_bool skips(parser_state *p, const char *s);
|
||||
static inline int
|
||||
nextc0(parser_state *p)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (p->s && p->s < p->send) {
|
||||
c = (unsigned char)*p->s++;
|
||||
return (unsigned char)*p->s++;
|
||||
}
|
||||
else {
|
||||
#ifndef MRB_NO_STDIO
|
||||
int c;
|
||||
|
||||
if (p->f) {
|
||||
c = fgetc(p->f);
|
||||
if (feof(p->f)) return -1;
|
||||
if (!feof(p->f)) return c;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
||||
@@ -10496,22 +10496,20 @@ static mrb_bool skips(parser_state *p, const char *s);
|
||||
static inline int
|
||||
nextc0(parser_state *p)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (p->s && p->s < p->send) {
|
||||
c = (unsigned char)*p->s++;
|
||||
return (unsigned char)*p->s++;
|
||||
}
|
||||
else {
|
||||
#ifndef MRB_NO_STDIO
|
||||
int c;
|
||||
|
||||
if (p->f) {
|
||||
c = fgetc(p->f);
|
||||
if (feof(p->f)) return -1;
|
||||
if (!feof(p->f)) return c;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
||||
Reference in New Issue
Block a user