From d08f795794b33a5d52e39c6b9f0c4e6e88fede3d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 13 Aug 2024 01:30:25 -0400 Subject: Partially working first draft of bigints --- ast.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 2e9afaed..69991e4c 100644 --- a/ast.c +++ b/ast.c @@ -5,6 +5,7 @@ #include #include "ast.h" +#include "builtins/integers.h" #include "builtins/text.h" static const char *OP_NAMES[] = { @@ -34,9 +35,9 @@ static CORD optional_tagged_type(const char *tag, type_ast_t *ast); CORD xml_escape(CORD text) { - text = Text$replace(text, "&", "&", INT64_MAX); - text = Text$replace(text, "<", "<", INT64_MAX); - text = Text$replace(text, ">", ">", INT64_MAX); + text = Text$replace(text, "&", "&", I(-1)); + text = Text$replace(text, "<", "<", I(-1)); + text = Text$replace(text, ">", ">", I(-1)); return text; } @@ -98,7 +99,7 @@ CORD ast_to_xml(ast_t *ast) T(Nil, "%r", type_ast_to_xml(data.type)) T(Bool, "", data.b ? "yes" : "no") T(Var, "%s", data.name) - T(Int, "%ld", data.bits, data.i) + T(Int, "%s", data.bits, data.str) T(Num, "%g", data.bits, data.n) T(TextLiteral, "%r", xml_escape(data.cord)) T(TextJoin, "%r", data.lang ? CORD_all(" lang=\"", data.lang, "\"") : CORD_EMPTY, ast_list_to_xml(data.children)) -- cgit v1.2.3