YAMLIO: Allow scalars to dictate quotation rules
[oota-llvm.git] / docs / YamlIO.rst
index b1917b6469e889b1206dbebcab400310aacbd21a..dfb348da2f470674e073e4b428b5d32b062f56a3 100644 (file)
@@ -426,8 +426,10 @@ looks like:
       static StringRef input(StringRef scalar, T &value) {
         // do custom parsing here.  Return the empty string on success,
         // or an error message on failure.
-        return StringRef(); 
+        return StringRef();
       }
+      // Determine if this scalar needs quotes.
+      static bool mustQuote(StringRef) { return true; }
     };