Merged r295:305 from the tags branch to the trunk

This commit is contained in:
Jesse Beder
2009-10-29 15:48:06 +00:00
parent fe57829aca
commit a372bfdc60
27 changed files with 973 additions and 145 deletions

View File

@@ -12,9 +12,11 @@ namespace YAML
void Scanner::SimpleKey::Validate()
{
// Note: pIndent will *not* be garbage here; see below
// Note: pIndent will *not* be garbage here;
// we "garbage collect" them so we can
// always refer to them
if(pIndent)
pIndent->isValid = true;
pIndent->status = IndentMarker::VALID;
if(pMapStart)
pMapStart->status = Token::VALID;
if(pKey)
@@ -23,8 +25,8 @@ namespace YAML
void Scanner::SimpleKey::Invalidate()
{
// Note: pIndent might be a garbage pointer here, but that's ok
// An indent will only be popped if the simple key is invalid
if(pIndent)
pIndent->status = IndentMarker::INVALID;
if(pMapStart)
pMapStart->status = Token::INVALID;
if(pKey)
@@ -68,7 +70,7 @@ namespace YAML
// first add a map start, if necessary
key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
if(key.pIndent) {
key.pIndent->isValid = false;
key.pIndent->status = IndentMarker::UNKNOWN;
key.pMapStart = key.pIndent->pStartToken;
key.pMapStart->status = Token::UNVERIFIED;
}
@@ -135,3 +137,4 @@ namespace YAML
m_simpleKeys.pop();
}
}