diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-09 19:02:13 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-09 19:02:13 -0500 |
| commit | cbdd357b41b4685c669755bfdd29c822d5dcc8c6 (patch) | |
| tree | 199ee8eaf17a938a9c68198dac95d1ce1f9b8353 /parse.c | |
| parent | 5131fdff6294b075cc760a8014ef8c9b6d1bf5d8 (diff) | |
Deprecate secret langs (just use one-member structs)
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -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) |
