diff options
| -rw-r--r-- | src/cdump.c | 2 | ||||
| -rw-r--r-- | src/parse.y | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/cdump.c b/src/cdump.c index 7029ae3de..f9525d042 100644 --- a/src/cdump.c +++ b/src/cdump.c @@ -146,7 +146,7 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f) } } memset(buf, 0, buf_len); - SOURCE_CODE(" irep->pool[%d] = mrb_str_new(mrb, \"%s\", %ld);", n, str_to_format(irep->pool[n], buf), RSTRING_LEN(irep->pool[n])); break; + SOURCE_CODE(" irep->pool[%d] = mrb_str_new(mrb, \"%s\", %d);", n, str_to_format(irep->pool[n], buf), RSTRING_LEN(irep->pool[n])); break; /* TODO MRB_TT_REGEX */ default: break; } diff --git a/src/parse.y b/src/parse.y index 5bce579e7..4c339f0f4 100644 --- a/src/parse.y +++ b/src/parse.y @@ -3056,12 +3056,11 @@ peek_n(parser_state *p, int c, int n) node *list = 0; int c0; - n++; /* must read 1 char */ - while (n--) { + do { c0 = nextc(p); if (c0 < 0) return FALSE; list = push(list, (node*)(intptr_t)c0); - } + } while(n--); if (p->pb) { p->pb = push(p->pb, (node*)list); } |
