diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parse.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/parse.c b/src/parse.c index 2fa3ee4..ef4f4dc 100644 --- a/src/parse.c +++ b/src/parse.c @@ -19,19 +19,19 @@ error(struct location loc, const char *fmt, ...) } static void -append(struct ast_path *path, const char *name) +append(struct path *path, const char *name) { - if (path->len >= path->cap) { - path->cap *= 2; - size_t sz = sizeof(const char *) * path->cap; + if (path->seglen >= path->segsz) { + path->segsz *= 2; + size_t sz = sizeof(const char *) * path->segsz; path->segments = must_realloc(path->segments, sz); } - path->segments[path->len++] = name; + path->segments[path->seglen++] = name; } static bool -parse_path(struct lexer *lexer, struct ast_path *out) +parse_path(struct lexer *lexer, struct path *out) { struct token name; @@ -41,8 +41,8 @@ parse_path(struct lexer *lexer, struct ast_path *out) out->segments = must_calloc(1, sizeof(const char *)); out->segments[0] = name.info.str; - out->len = 1; - out->cap = 1; + out->seglen = 1; + out->segsz = 1; while (match(lexer, T_MODDELIM)) { if (lex(lexer, &name) != T_NAME) { @@ -70,7 +70,7 @@ parse_import(struct lexer *lexer, struct ast_import *out) out->name = token.info.str; } else { unlex(lexer, &token); - out->name = out->path.segments[out->path.len - 1]; + out->name = out->path.segments[out->path.seglen - 1]; } if (!match(lexer, T_SEMICOLON)) { |