llvm.org GIT mirror llvm / e9cf283
Remove trailing whitespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190472 91177308-0d34-0410-b5e6-96231b3b80d8 Rui Ueyama 6 years ago
2 changed file(s) with 7 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3939 // Input
4040 //===----------------------------------------------------------------------===//
4141
42 Input::Input(StringRef InputContent, void *Ctxt)
43 : IO(Ctxt),
42 Input::Input(StringRef InputContent, void *Ctxt)
43 : IO(Ctxt),
4444 Strm(new Stream(InputContent, SrcMgr)),
4545 CurrentNode(NULL) {
4646 DocIterator = Strm->begin();
4747 }
4848
4949 Input::~Input() {
50
5150 }
5251
5352 error_code Input::error() {
549548 // if the key/value is the only thing in the map and the map is used in
550549 // a sequence. This detects if the this sequence is the first key/value
551550 // in map that itself is embedded in a sequnce.
552 if (StateStack.size() < 2)
551 if (StateStack.size() < 2)
553552 return true;
554 if (StateStack.back() != inMapFirstKey)
553 if (StateStack.back() != inMapFirstKey)
555554 return true;
556555 return (StateStack[StateStack.size()-2] != inSeq);
557556 }
656656 map.numbers.push_back(1024);
657657
658658 llvm::raw_string_ostream ostr(intermediate);
659 Output yout(ostr);
659 Output yout(ostr);
660660 yout << map;
661
661
662662 // Verify sequences were written in flow style
663663 ostr.flush();
664664 llvm::StringRef flowOut(intermediate);
14021402 Input yin(intermediate);
14031403 OptionalTestSeq Seq2;
14041404 yin >> Seq2;
1405
1405
14061406 EXPECT_FALSE(yin.error());
14071407
14081408 EXPECT_EQ(4UL, Seq2.Tests.size());