From 7126755275f12e6278031e78ff33f65801b133dd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 11 Sep 2024 01:31:31 -0400 Subject: Add optional types --- ast.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 0dfddb9a..869168f9 100644 --- a/ast.c +++ b/ast.c @@ -168,13 +168,14 @@ CORD type_ast_to_xml(type_ast_t *t) #define T(type, ...) case type: { auto data = t->__data.type; (void)data; return CORD_asprintf(__VA_ARGS__); } T(UnknownTypeAST, "") T(VarTypeAST, "%s", data.name) - T(PointerTypeAST, "%r", - data.is_optional ? "yes" : "no", data.is_stack ? "yes" : "no", data.is_readonly ? "yes" : "no", type_ast_to_xml(data.pointed)) + T(PointerTypeAST, "%r", + data.is_stack ? "yes" : "no", data.is_readonly ? "yes" : "no", type_ast_to_xml(data.pointed)) T(ArrayTypeAST, "%r", type_ast_to_xml(data.item)) T(SetTypeAST, "%r", type_ast_to_xml(data.item)) T(ChannelTypeAST, "%r", type_ast_to_xml(data.item)) T(TableTypeAST, "%r %r", type_ast_to_xml(data.key), type_ast_to_xml(data.value)) T(FunctionTypeAST, "%r %r", arg_list_to_xml(data.args), type_ast_to_xml(data.ret)) + T(OptionalTypeAST, "%r", data.type) #undef T default: return CORD_EMPTY; } -- cgit v1.2.3