Pure OCaml Yaml 1.2 reader and writer using Bytesrw

cram

Changed files
+11 -6
tests
+1
tests/cram/multiple_escapes.yml
···
+
text: "Tab:\t Newline:\n Quote:\" Backslash:\\\\"
+9 -6
tests/cram/scalars.t
···
$ echo 'text: "Col1\tCol2\tCol3"' | yamlcat --json
{"text": "Col1\tCol2\tCol3"}
-
Double-quoted with backslash escape
+
Double-quoted with backslash escape (Windows path)
+
Note: Using YAML file instead of echo to avoid shell interpretation
+
The echo command would interpret \\ as \ before yamlcat sees it
-
$ echo 'path: "C:\\Users\\Name"' | yamlcat --json
-
Error: invalid hex escape: at line 1, columns 12-12
-
[1]
+
$ yamlcat --json windows_path.yml
+
{"path": "C:\\Users\\Name"}
Double-quoted with escaped quote
···
{"text": "She said \"hello\""}
Double-quoted with multiple escape sequences
+
Note: Using YAML file instead of echo to avoid shell interpretation
+
The echo command interprets \t and \n before yamlcat sees them
-
$ echo 'text: "Tab:\t Newline:\n Quote:\" Backslash:\\\\"' | yamlcat --json
-
{"text": "Tab:\t Newline: Quote:\" Backslash:\\"}
+
$ yamlcat --json multiple_escapes.yml
+
{"text": "Tab:\t Newline:\n Quote:\" Backslash:\\\\"}
Empty double-quoted string
+1
tests/cram/windows_path.yml
···
+
path: "C:\\Users\\Name"