diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-04-10 07:37:33 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-04-10 07:37:33 +0000 |
commit | 878657074a3d65262d4c010dc2261ea688f19e8c (patch) | |
tree | 7c36abbfa347bd998b0a993f3875e9760d029fa5 /docs/YamlIO.rst | |
parent | fb52dba011ae1785654f2f3a3cedef2119789dc2 (diff) | |
download | llvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.gz llvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.bz2 llvm-878657074a3d65262d4c010dc2261ea688f19e8c.tar.xz |
YAMLIO: Allow scalars to dictate quotation rules
Introduce ScalarTraits::mustQuote which determines whether or not a
StringRef needs quoting before it is acceptable to output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/YamlIO.rst')
-rw-r--r-- | docs/YamlIO.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/YamlIO.rst b/docs/YamlIO.rst index b1917b6469..dfb348da2f 100644 --- a/docs/YamlIO.rst +++ b/docs/YamlIO.rst @@ -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; } }; |