Updated signature of Parser::GetNextDocument (issue 45)

This commit is contained in:
Jesse Beder
2009-09-29 18:25:11 +00:00
parent 94eb7f1dbd
commit 7db39e66b8
3 changed files with 7 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ namespace YAML
// GetNextDocument
// . Reads the next document in the queue (of tokens).
// . Throws a ParserException on error.
void Parser::GetNextDocument(Node& document)
bool Parser::GetNextDocument(Node& document)
{
// clear node
document.Clear();
@@ -43,7 +43,7 @@ namespace YAML
// we better have some tokens in the queue
if(m_pScanner->empty())
return;
return false;
// first eat doc start (optional)
if(m_pScanner->peek().type == Token::DOC_START)
@@ -58,6 +58,8 @@ namespace YAML
// clear anchors from the scanner, which are no longer relevant
m_pScanner->ClearAnchors();
return true;
}
// ParseDirectives