From 2bc8e5f74cdfca319f04ac2e6c13d04c05059137 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 16:06:58 -0400 Subject: Deprecate `extern` keyword --- src/parse/files.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/parse/files.c') diff --git a/src/parse/files.c b/src/parse/files.c index 5ff41c68..caecbbe8 100644 --- a/src/parse/files.c +++ b/src/parse/files.c @@ -43,8 +43,8 @@ ast_t *parse_file_body(parse_ctx_t *ctx, const char *pos) { if ((stmt = optional(ctx, &pos, parse_struct_def)) || (stmt = optional(ctx, &pos, parse_func_def)) || (stmt = optional(ctx, &pos, parse_enum_def)) || (stmt = optional(ctx, &pos, parse_lang_def)) || (stmt = optional(ctx, &pos, parse_extend)) || (stmt = optional(ctx, &pos, parse_convert_def)) - || (stmt = optional(ctx, &pos, parse_use)) || (stmt = optional(ctx, &pos, parse_extern)) - || (stmt = optional(ctx, &pos, parse_inline_c)) || (stmt = optional(ctx, &pos, parse_top_declaration))) { + || (stmt = optional(ctx, &pos, parse_use)) || (stmt = optional(ctx, &pos, parse_inline_c)) + || (stmt = optional(ctx, &pos, parse_top_declaration))) { statements = new (ast_list_t, .ast = stmt, .next = statements); pos = stmt->end; whitespace(ctx, &pos); // TODO: check for newline @@ -151,17 +151,6 @@ ast_t *parse_use(parse_ctx_t *ctx, const char *pos) { return NewAST(ctx->file, start, pos, Use, .var = var, .path = name, .what = what); } -ast_t *parse_extern(parse_ctx_t *ctx, const char *pos) { - const char *start = pos; - if (!match_word(&pos, "extern")) return NULL; - spaces(&pos); - const char *name = get_id(&pos); - spaces(&pos); - if (!match(&pos, ":")) parser_err(ctx, start, pos, "I couldn't get a type for this extern"); - type_ast_t *type = expect(ctx, start, &pos, parse_type, "I couldn't parse the type for this extern"); - return NewAST(ctx->file, start, pos, Extern, .name = name, .type = type); -} - public ast_t *parse_file_str(const char *str) { file_t *file = spoof_file("", str); -- cgit v1.2.3