aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/parse.c b/src/parse.c
index b9a695b9..d142e780 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -89,7 +89,7 @@ static ast_t *parse_non_optional_suffix(parse_ctx_t *ctx, ast_t *lhs);
static ast_t *parse_optional_conditional_suffix(parse_ctx_t *ctx, ast_t *stmt);
static ast_t *parse_optional_suffix(parse_ctx_t *ctx, ast_t *lhs);
static arg_ast_t *parse_args(parse_ctx_t *ctx, const char **pos);
-static type_ast_t *parse_array_type(parse_ctx_t *ctx, const char *pos);
+static type_ast_t *parse_list_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_func_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_non_optional_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_pointer_type(parse_ctx_t *ctx, const char *pos);
@@ -97,7 +97,7 @@ static type_ast_t *parse_set_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_table_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_type(parse_ctx_t *ctx, const char *pos);
static type_ast_t *parse_type_name(parse_ctx_t *ctx, const char *pos);
-static PARSER(parse_array);
+static PARSER(parse_list);
static PARSER(parse_assignment);
static PARSER(parse_block);
static PARSER(parse_bool);
@@ -564,13 +564,13 @@ type_ast_t *parse_func_type(parse_ctx_t *ctx, const char *pos) {
return NewTypeAST(ctx->file, start, pos, FunctionTypeAST, .args=args, .ret=ret);
}
-type_ast_t *parse_array_type(parse_ctx_t *ctx, const char *pos) {
+type_ast_t *parse_list_type(parse_ctx_t *ctx, const char *pos) {
const char *start = pos;
if (!match(&pos, "[")) return NULL;
type_ast_t *type = expect(ctx, start, &pos, parse_type,
- "I couldn't parse an array item type after this point");
- expect_closing(ctx, &pos, "]", "I wasn't able to parse the rest of this array type");
- return NewTypeAST(ctx->file, start, pos, ArrayTypeAST, .item=type);
+ "I couldn't parse a list item type after this point");
+ expect_closing(ctx, &pos, "]", "I wasn't able to parse the rest of this list type");
+ return NewTypeAST(ctx->file, start, pos, ListTypeAST, .item=type);
}
type_ast_t *parse_pointer_type(parse_ctx_t *ctx, const char *pos) {
@@ -614,7 +614,7 @@ type_ast_t *parse_non_optional_type(parse_ctx_t *ctx, const char *pos) {
type_ast_t *type = NULL;
bool success = (false
|| (type=parse_pointer_type(ctx, pos))
- || (type=parse_array_type(ctx, pos))
+ || (type=parse_list_type(ctx, pos))
|| (type=parse_table_type(ctx, pos))
|| (type=parse_set_type(ctx, pos))
|| (type=parse_type_name(ctx, pos))
@@ -698,7 +698,7 @@ static INLINE bool match_separator(const char **pos) { // Either comma or newlin
}
}
-PARSER(parse_array) {
+PARSER(parse_list) {
const char *start = pos;
if (!match(&pos, "[")) return NULL;
@@ -719,10 +719,10 @@ PARSER(parse_array) {
break;
}
whitespace(&pos);
- expect_closing(ctx, &pos, "]", "I wasn't able to parse the rest of this array");
+ expect_closing(ctx, &pos, "]", "I wasn't able to parse the rest of this list");
REVERSE_LIST(items);
- return NewAST(ctx->file, start, pos, Array, .items=items);
+ return NewAST(ctx->file, start, pos, List, .items=items);
}
PARSER(parse_table) {
@@ -1466,7 +1466,7 @@ PARSER(parse_term_no_suffix) {
|| (term=parse_set(ctx, pos))
|| (term=parse_deserialize(ctx, pos))
|| (term=parse_var(ctx, pos))
- || (term=parse_array(ctx, pos))
+ || (term=parse_list(ctx, pos))
|| (term=parse_reduction(ctx, pos))
|| (term=parse_pass(ctx, pos))
|| (term=parse_defer(ctx, pos))