[PATCH] D47468: [YAML] Double-quote multiline string scalars

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 04:17:52 PDT 2018


sammccall added a comment.

As discussed offline, it'd be nice to assert the actual serialized output in the test. At least in principle we want this to interop with *other* parsers.



================
Comment at: include/llvm/Support/YAMLTraits.h:543
     case ' ':
-    // TAB (0x9), LF (0xA), CR (0xD) and NEL (0x85) are allowed.
+    // TAB (0x9) is allowed.
     case 0x9:
----------------
allowed -> allowed in unquoted strings (for clarity)


================
Comment at: include/llvm/Support/YAMLTraits.h:548
+    // in 'key: value' pairs unless double-quoted.
     case 0xA:
     case 0xD:
----------------
0xa and 0xd are both printable, so single-quoting should be sufficient


================
Comment at: include/llvm/Support/YAMLTraits.h:550
     case 0xD:
     case 0x85:
+      return QuotingType::Double;
----------------
NEL is `U+0085`, but that won't encode to a `0x85` byte (at least not under UTF-8). So mentioning `0x85` in this switch is a (pre-existing) bug, let's just remove it.


Repository:
  rL LLVM

https://reviews.llvm.org/D47468





More information about the llvm-commits mailing list