summaryrefslogtreecommitdiff
path: root/utils/yaml-bench
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-05-13 23:10:51 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-05-13 23:10:51 +0000
commitb96942f6ec1c91a4531e7ecf845abdba0e5285f6 (patch)
tree08abde5057ffad1b25bcc6fc582d0a8536198e8a /utils/yaml-bench
parent7c001dac7a65dc2560f116bbd907968c3150193f (diff)
YAML: Implement block scalar parsing.
This commit implements the parsing of YAML block scalars. Some code existed for it before, but it couldn't parse block scalars. This commit adds a new yaml node type to represent the block scalar values. This commit also deletes the 'spec-09-27' and 'spec-09-28' tests as they are identical to the test file 'spec-09-26'. This commit introduces 3 new utility functions to the YAML scanner class: `skip_s_space`, `advanceWhile` and `consumeLineBreakIfPresent`. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D9503 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/yaml-bench')
-rw-r--r--utils/yaml-bench/YAMLBench.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/yaml-bench/YAMLBench.cpp b/utils/yaml-bench/YAMLBench.cpp
index bd5aa152dff..634622a710c 100644
--- a/utils/yaml-bench/YAMLBench.cpp
+++ b/utils/yaml-bench/YAMLBench.cpp
@@ -96,6 +96,8 @@ static void dumpNode( yaml::Node *n
SmallString<32> Storage;
StringRef Val = sn->getValue(Storage);
outs() << prettyTag(n) << " \"" << yaml::escape(Val) << "\"";
+ } else if (yaml::BlockScalarNode *BN = dyn_cast<yaml::BlockScalarNode>(n)) {
+ outs() << prettyTag(n) << " \"" << yaml::escape(BN->getValue()) << "\"";
} else if (yaml::SequenceNode *sn = dyn_cast<yaml::SequenceNode>(n)) {
outs() << prettyTag(n) << " [\n";
++Indent;