aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-17 23:22:23 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-17 23:22:23 -0500
commitc678acfb19ae20932d9a1a6d77eea54ed75f545b (patch)
tree2c478f95d55c1ac1ba6c41c52eb5efd8c25af8dd
parent4a5c651d43f106b8e19b485646c64cb576a75cfb (diff)
Quote strings in AST debug strs
-rw-r--r--ast.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ast.c b/ast.c
index 8ad13943..37ce837b 100644
--- a/ast.c
+++ b/ast.c
@@ -5,6 +5,7 @@
#include <printf.h>
#include "ast.h"
+#include "builtins/string.h"
static const char *OP_NAMES[] = {
[BINOP_UNKNOWN]="unknown",
@@ -125,9 +126,9 @@ CORD ast_to_cord(ast_t *ast)
T(EnumDef, "(%s, tags=%r, namespace=%r)", data.name, tags_to_cord(data.tags), ast_to_cord(data.namespace))
T(Index, "(indexed=%r, index=%r)", ast_to_cord(data.indexed), ast_to_cord(data.index))
T(FieldAccess, "(fielded=%r, field=%s)", ast_to_cord(data.fielded), data.field)
- T(DocTest, "(expr=%r, output=%s)", ast_to_cord(data.expr), data.output ? data.output : "")
- T(Use, "(%s)", data.path)
- T(LinkerDirective, "(%s)", data.directive)
+ T(DocTest, "(expr=%r, output=%r)", ast_to_cord(data.expr), Str__quoted(data.output, true))
+ T(Use, "(%s)", Str__quoted(data.path, true))
+ T(LinkerDirective, "(%s)", Str__quoted(data.directive, true))
#undef T
}
return NULL;