Added some parser exceptions.

This commit is contained in:
Jesse Beder 2008-07-02 05:00:32 +00:00
parent 901d16a96f
commit 2ccbfeff47
9 changed files with 201 additions and 30 deletions

View file

@ -56,10 +56,10 @@ namespace YAML
while(1) {
Token *pToken = pScanner->PeekNextToken();
if(!pToken)
break; // TODO: throw?
throw SeqEndNotFound();
if(pToken->type != TT_BLOCK_ENTRY && pToken->type != TT_BLOCK_END)
break; // TODO: throw?
throw SeqEndNotFound();
pScanner->PopNextToken();
if(pToken->type == TT_BLOCK_END)
@ -99,7 +99,7 @@ namespace YAML
while(1) {
Token *pToken = pScanner->PeekNextToken();
if(!pToken)
break; // TODO: throw?
throw SeqEndNotFound();
// first check for end
if(pToken->type == TT_FLOW_SEQ_END) {
@ -117,7 +117,7 @@ namespace YAML
if(pToken->type == TT_FLOW_ENTRY)
pScanner->EatNextToken();
else if(pToken->type != TT_FLOW_SEQ_END)
break; // TODO: throw?
throw SeqEndNotFound();
}
}