aboutsummaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-24 16:36:27 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-24 16:36:27 -0500
commitd4b10514fbe3afc7229efe74b015a664b52eba33 (patch)
tree133cf2fd377ab8acbfa65908d04473ce0dd0ca49 /ast.c
parent1e3fb8a2c0cca385d65c52679411b118b5fb4641 (diff)
Clean up some more null->none renames and fix the documentation. Also
change the literal syntax to `NONE:T` instead of `!T`
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ast.c b/ast.c
index 86265454..750245f4 100644
--- a/ast.c
+++ b/ast.c
@@ -101,7 +101,7 @@ CORD ast_to_xml(ast_t *ast)
switch (ast->tag) {
#define T(type, ...) case type: { auto data = ast->__data.type; (void)data; return CORD_asprintf(__VA_ARGS__); }
T(Unknown, "<Unknown>")
- T(Null, "<Null>%r</Null>", type_ast_to_xml(data.type))
+ T(None, "<None>%r</None>", type_ast_to_xml(data.type))
T(Bool, "<Bool value=\"%s\" />", data.b ? "yes" : "no")
T(Var, "<Var>%s</Var>", data.name)
T(Int, "<Int>%s</Int>", data.str)
@@ -203,7 +203,7 @@ int printf_ast(FILE *stream, const struct printf_info *info, const void *const a
PUREFUNC bool is_idempotent(ast_t *ast)
{
switch (ast->tag) {
- case Int: case Bool: case Num: case Var: case Null: case TextLiteral: return true;
+ case Int: case Bool: case Num: case Var: case None: case TextLiteral: return true;
case Index: {
auto index = Match(ast, Index);
return is_idempotent(index->indexed) && index->index != NULL && is_idempotent(index->index);