aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-12 15:56:24 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-12 15:56:24 -0400
commit3481042259c1db4d9fb4e50d5e91e8c58e8cdac5 (patch)
treefa3a470a0ac5cce72bb9380c64495c00fa4da179 /parse.c
parentf6f89265b7eb73bd9a036133033e4fd654196b50 (diff)
Simplify interfaces by requiring all functions are pointer methods
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index b657d353..7e9c246d 100644
--- a/parse.c
+++ b/parse.c
@@ -1825,10 +1825,9 @@ PARSER(parse_interface_def) {
if (!match(&pos, "("))
parser_err(ctx, pos, pos, "I expected a '(' and a list of fields here");
- type_ast_t *type_param = expect(ctx, start, &pos, parse_type, "I couldn't parse the type parameter for this interface");
whitespace(&pos);
- expect_str(ctx, start, &pos, ";", "I expected a ';' here");
arg_ast_t *fields = parse_args(ctx, &pos, false);
+ whitespace(&pos);
expect_closing(ctx, &pos, ")", "I wasn't able to parse the rest of this interface definition");
ast_t *namespace = NULL;
@@ -1844,7 +1843,7 @@ PARSER(parse_interface_def) {
if (!namespace)
namespace = NewAST(ctx->file, pos, pos, Block, .statements=NULL);
- return NewAST(ctx->file, start, pos, InterfaceDef, .name=name, .type_parameter=type_param, .fields=fields, .namespace=namespace);
+ return NewAST(ctx->file, start, pos, InterfaceDef, .name=name, .fields=fields, .namespace=namespace);
}
arg_ast_t *parse_args(parse_ctx_t *ctx, const char **pos, bool allow_unnamed)