diff options
author | dim <dim@FreeBSD.org> | 2015-06-09 19:06:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-09 19:06:30 +0000 |
commit | 9b27354f6f3e9086d5f7abbc373b617209fc35b2 (patch) | |
tree | 1dc5e75ab222a9ead44c699eceafab7a6ca7b310 /lib/Support/YAMLTraits.cpp | |
parent | 782067d0278612ee75d024b9b135c221c327e9e8 (diff) | |
download | FreeBSD-src-9b27354f6f3e9086d5f7abbc373b617209fc35b2.zip FreeBSD-src-9b27354f6f3e9086d5f7abbc373b617209fc35b2.tar.gz |
Vendor import of llvm trunk r239412:
https://llvm.org/svn/llvm-project/llvm/trunk@239412
Diffstat (limited to 'lib/Support/YAMLTraits.cpp')
-rw-r--r-- | lib/Support/YAMLTraits.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index 90f34f6..6b59a16 100644 --- a/lib/Support/YAMLTraits.cpp +++ b/lib/Support/YAMLTraits.cpp @@ -97,6 +97,10 @@ bool Input::nextDocument() { return ++DocIterator != Strm->end(); } +const Node *Input::getCurrentNode() const { + return CurrentNode ? CurrentNode->_node : nullptr; +} + bool Input::mapTag(StringRef Tag, bool Default) { std::string foundTag = CurrentNode->_node->getVerbatimTag(); if (foundTag.empty()) { @@ -400,9 +404,10 @@ bool Input::canElideEmptySequence() { // Output //===----------------------------------------------------------------------===// -Output::Output(raw_ostream &yout, void *context) +Output::Output(raw_ostream &yout, void *context, int WrapColumn) : IO(context), Out(yout), + WrapColumn(WrapColumn), Column(0), ColumnAtFlowStart(0), ColumnAtMapFlowStart(0), @@ -525,7 +530,7 @@ void Output::endFlowSequence() { bool Output::preflightFlowElement(unsigned, void *&) { if (NeedFlowSequenceComma) output(", "); - if (Column > 70) { + if (WrapColumn && Column > WrapColumn) { output("\n"); for (int i = 0; i < ColumnAtFlowStart; ++i) output(" "); @@ -716,7 +721,7 @@ void Output::paddedKey(StringRef key) { void Output::flowKey(StringRef Key) { if (StateStack.back() == inFlowMapOtherKey) output(", "); - if (Column > 70) { + if (WrapColumn && Column > WrapColumn) { output("\n"); for (int I = 0; I < ColumnAtMapFlowStart; ++I) output(" "); |