mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Added some parser exceptions.
This commit is contained in:
parent
901d16a96f
commit
2ccbfeff47
9 changed files with 201 additions and 30 deletions
11
map.cpp
11
map.cpp
|
@ -2,6 +2,7 @@
|
|||
#include "node.h"
|
||||
#include "scanner.h"
|
||||
#include "token.h"
|
||||
#include "exceptions.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
|
@ -56,10 +57,10 @@ namespace YAML
|
|||
while(1) {
|
||||
Token *pToken = pScanner->PeekNextToken();
|
||||
if(!pToken)
|
||||
break; // TODO: throw?
|
||||
throw MapEndNotFound();
|
||||
|
||||
if(pToken->type != TT_KEY && pToken->type != TT_BLOCK_END)
|
||||
break; // TODO: throw?
|
||||
throw MapEndNotFound();
|
||||
|
||||
pScanner->PopNextToken();
|
||||
if(pToken->type == TT_BLOCK_END)
|
||||
|
@ -88,7 +89,7 @@ namespace YAML
|
|||
while(1) {
|
||||
Token *pToken = pScanner->PeekNextToken();
|
||||
if(!pToken)
|
||||
break; // TODO: throw?
|
||||
throw MapEndNotFound();
|
||||
|
||||
// first check for end
|
||||
if(pToken->type == TT_FLOW_MAP_END) {
|
||||
|
@ -98,7 +99,7 @@ namespace YAML
|
|||
|
||||
// now it better be a key
|
||||
if(pToken->type != TT_KEY)
|
||||
break; // TODO: throw?
|
||||
throw MapEndNotFound();
|
||||
|
||||
pScanner->PopNextToken();
|
||||
|
||||
|
@ -120,7 +121,7 @@ namespace YAML
|
|||
if(pToken->type == TT_FLOW_ENTRY)
|
||||
pScanner->EatNextToken();
|
||||
else if(pToken->type != TT_FLOW_MAP_END)
|
||||
break; // TODO: throw?
|
||||
throw MapEndNotFound();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue