fixed: quoting KDL string nodes containing `//` to prevent them from being interprete...
authorFumihiko Hata <hatappo@users.noreply.github.com>
Thu, 4 Jan 2024 16:40:59 +0000 (01:40 +0900)
committerFumihiko Hata <hatappo@users.noreply.github.com>
Thu, 4 Jan 2024 16:40:59 +0000 (01:40 +0900)
core/encoding/kdl/encoder.onyx
shared/lib/darwin_arm64/lib/libovmwasm.a

index b1fe86618a8f29b0be24ffae352624e2d62943ee..8ea46d1beaf47692f32d7d3672d7fc33a5d4b489 100644 (file)
@@ -4,6 +4,7 @@ package core.encoding.kdl
 KDL_TAB_SIZE :: 4
 
 use core {io}
+use core.string {contains}
 
 write :: (d: &Document, w: &io.Writer) {
     for d.nodes {
@@ -19,7 +20,8 @@ write_node :: (n: &Node, w: &io.Writer, indentation := 0) {
         io.write_format(w, "({}) ", ta);
     });
 
-    io.write(w, n.node);
+    if contains(n.node, "//") do io.write_format(w, "{\"}", n.node);
+    else do io.write(w, n.node);
     io.write(w, " ");
 
     for n.values {
index 515623ffb1aced4ae25691686064777d5192e112..fd8ff64d16e4d8286d7c484306bb22ffdd8ad636 100644 (file)
Binary files a/shared/lib/darwin_arm64/lib/libovmwasm.a and b/shared/lib/darwin_arm64/lib/libovmwasm.a differ