summaryrefslogtreecommitdiff
path: root/docs/YamlIO.rst
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-10 07:37:33 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-10 07:37:33 +0000
commit878657074a3d65262d4c010dc2261ea688f19e8c (patch)
tree7c36abbfa347bd998b0a993f3875e9760d029fa5 /docs/YamlIO.rst
parentfb52dba011ae1785654f2f3a3cedef2119789dc2 (diff)
downloadllvm-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.rst4
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; }
};