aboutsummaryrefslogtreecommitdiff
path: root/src/parse/files.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-21 16:06:58 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-21 16:06:58 -0400
commit2bc8e5f74cdfca319f04ac2e6c13d04c05059137 (patch)
tree4e3960e6a9f97573c9a63d6cbd74ea67bf20ffeb /src/parse/files.c
parent40e332fdbde4cc082ba9d0e4f5e8c53612bfec68 (diff)
Deprecate `extern` keyword
Diffstat (limited to 'src/parse/files.c')
-rw-r--r--src/parse/files.c15
1 files changed, 2 insertions, 13 deletions
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("<string>", str);