aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-05 18:05:07 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-05 18:05:07 -0400
commitc74fba540448f1d4b1aec4de8f3d9ffc395fdde0 (patch)
tree67f2f62e2ccf1889ebbeef725a6782b8ba9f5912 /src/parse
parent398d2cab6988e20c59e7037ff7ef551540339abb (diff)
Deprecate `deserialize` keyword and `.serialized()` method
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/expressions.c26
-rw-r--r--src/parse/expressions.h1
-rw-r--r--src/parse/utils.c6
3 files changed, 7 insertions, 26 deletions
diff --git a/src/parse/expressions.c b/src/parse/expressions.c
index 3cb47669..5be48b89 100644
--- a/src/parse/expressions.c
+++ b/src/parse/expressions.c
@@ -157,24 +157,6 @@ ast_t *parse_none(parse_ctx_t *ctx, const char *pos) {
return NewAST(ctx->file, start, pos, None);
}
-ast_t *parse_deserialize(parse_ctx_t *ctx, const char *pos) {
- const char *start = pos;
- if (!match_word(&pos, "deserialize")) return NULL;
-
- spaces(&pos);
- expect_str(ctx, start, &pos, "(", "I expected arguments for this `deserialize` call");
- whitespace(ctx, &pos);
- ast_t *value = expect(ctx, start, &pos, parse_extended_expr, "I expected an expression here");
- whitespace(ctx, &pos);
- expect_str(ctx, start, &pos, "->",
- "I expected a `-> Type` for this `deserialize` call so I know what it deserializes to");
- whitespace(ctx, &pos);
- type_ast_t *type = expect(ctx, start, &pos, parse_type, "I couldn't parse the type for this deserialization");
- whitespace(ctx, &pos);
- expect_closing(ctx, &pos, ")", "I expected a closing ')' for this `deserialize` call");
- return NewAST(ctx->file, start, pos, Deserialize, .value = value, .type = type);
-}
-
ast_t *parse_var(parse_ctx_t *ctx, const char *pos) {
const char *start = pos;
const char *name = get_id(&pos);
@@ -190,10 +172,10 @@ ast_t *parse_term_no_suffix(parse_ctx_t *ctx, const char *pos) {
|| (term = parse_heap_alloc(ctx, pos)) || (term = parse_stack_reference(ctx, pos))
|| (term = parse_bool(ctx, pos)) || (term = parse_text(ctx, pos)) || (term = parse_path(ctx, pos))
|| (term = parse_lambda(ctx, pos)) || (term = parse_parens(ctx, pos)) || (term = parse_table(ctx, pos))
- || (term = parse_deserialize(ctx, pos)) || (term = parse_var(ctx, pos)) || (term = parse_list(ctx, pos))
- || (term = parse_reduction(ctx, pos)) || (term = parse_pass(ctx, pos)) || (term = parse_defer(ctx, pos))
- || (term = parse_skip(ctx, pos)) || (term = parse_stop(ctx, pos)) || (term = parse_return(ctx, pos))
- || (term = parse_not(ctx, pos)) || (term = parse_inline_c(ctx, pos)));
+ || (term = parse_var(ctx, pos)) || (term = parse_list(ctx, pos)) || (term = parse_reduction(ctx, pos))
+ || (term = parse_pass(ctx, pos)) || (term = parse_defer(ctx, pos)) || (term = parse_skip(ctx, pos))
+ || (term = parse_stop(ctx, pos)) || (term = parse_return(ctx, pos)) || (term = parse_not(ctx, pos))
+ || (term = parse_inline_c(ctx, pos)));
return term;
}
diff --git a/src/parse/expressions.h b/src/parse/expressions.h
index c7c97f24..8da13b0e 100644
--- a/src/parse/expressions.h
+++ b/src/parse/expressions.h
@@ -19,4 +19,3 @@ ast_t *parse_stack_reference(parse_ctx_t *ctx, const char *pos);
ast_t *parse_term(parse_ctx_t *ctx, const char *pos);
ast_t *parse_term_no_suffix(parse_ctx_t *ctx, const char *pos);
ast_t *parse_var(parse_ctx_t *ctx, const char *pos);
-ast_t *parse_deserialize(parse_ctx_t *ctx, const char *pos);
diff --git a/src/parse/utils.c b/src/parse/utils.c
index 28cf0964..f1b518ca 100644
--- a/src/parse/utils.c
+++ b/src/parse/utils.c
@@ -12,9 +12,9 @@
#include "utils.h"
static const char *keywords[] = {
- "C_code", "_max_", "_min_", "and", "assert", "break", "continue", "defer", "deserialize", "do", "else", "enum",
- "for", "func", "if", "in", "lang", "mod", "mod1", "no", "none", "not", "or", "pass",
- "return", "skip", "skip", "stop", "struct", "then", "unless", "use", "when", "while", "xor", "yes",
+ "C_code", "_max_", "_min_", "and", "assert", "break", "continue", "defer", "do", "else", "enum", "for",
+ "func", "if", "in", "lang", "mod", "mod1", "no", "none", "not", "or", "pass", "return",
+ "skip", "skip", "stop", "struct", "then", "unless", "use", "when", "while", "xor", "yes",
};
CONSTFUNC bool is_keyword(const char *word) {