1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-26 21:27:42 +00:00

More work on dogfood repl.

This commit is contained in:
Calvin Rose
2017-05-09 20:06:53 -04:00
parent fd72219a2a
commit b7083f6f18
6 changed files with 15 additions and 17 deletions

View File

@@ -62,7 +62,7 @@ static GstParseState *parser_peek(GstParser *p) {
if (!p->count) {
return NULL;
}
return p->data + p->count - 1;
return p->data + (p->count - 1);
}
/* Remove the top state from the ParseStack */
@@ -88,8 +88,9 @@ static GstValue quote(GstParser *p, GstValue x) {
static void parser_push(GstParser *p, ParseType type, uint8_t character) {
GstParseState *top;
if (p->count >= p->cap) {
uint32_t newCap = 2 * p->count;
GstParseState *data = gst_alloc(p->vm, newCap);
uint32_t newCap = 2 * p->count + 2;
GstParseState *data = gst_alloc(p->vm, newCap * sizeof(GstParseState));
gst_memcpy(data, p->data, p->cap * sizeof(GstParseState));
p->data = data;
p->cap = newCap;
}