From cbdd357b41b4685c669755bfdd29c822d5dcc8c6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 9 Mar 2024 19:02:13 -0500 Subject: Deprecate secret langs (just use one-member structs) --- parse.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index 9851d009..f8e7949a 100644 --- a/parse.c +++ b/parse.c @@ -1645,9 +1645,7 @@ ast_t *parse_enum_def(parse_ctx_t *ctx, const char *pos) { PARSER(parse_lang_def) { const char *start = pos; - // lang Name - // lang Name(secret) - + // lang Name [namespace...] if (!match_word(&pos, "lang")) return NULL; int64_t starting_indent = get_indent(ctx->file, pos); spaces(&pos); @@ -1656,17 +1654,6 @@ PARSER(parse_lang_def) { parser_err(ctx, start, pos, "I expected a name for this lang"); spaces(&pos); - bool secret = false; - if (match(&pos, "(")) { - whitespace(&pos); - if (match_word(&pos, "secret")) { - secret = true; - whitespace(&pos); - match(&pos, ","); - } - expect_closing(ctx, &pos, ")", "I wasn't able to parse the rest of this lang definition"); - } - const char *ns_pos = pos; whitespace(&ns_pos); int64_t ns_indent = get_indent(ctx->file, ns_pos); @@ -1678,7 +1665,7 @@ PARSER(parse_lang_def) { if (!namespace) namespace = NewAST(ctx->file, pos, pos, Block, .statements=NULL); - return NewAST(ctx->file, start, pos, LangDef, .name=name, .secret=secret, .namespace=namespace); + return NewAST(ctx->file, start, pos, LangDef, .name=name, .namespace=namespace); } arg_ast_t *parse_args(parse_ctx_t *ctx, const char **pos, bool allow_unnamed) -- cgit v1.2.3