Combined the myriad ScannerExceptions and ParserExceptions to a single ParserException class that has a message and a line/column position in the file where the error occurred.

This commit is contained in:
Jesse Beder
2008-07-08 05:48:38 +00:00
parent 115cf601e9
commit 6c2946bf58
12 changed files with 114 additions and 113 deletions

View File

@@ -21,7 +21,7 @@ namespace YAML
void Scanner::SimpleKey::Invalidate()
{
if(required)
throw RequiredSimpleKeyNotFound();
throw ParserException(line, column, "required simple key not found");
if(pMapStart)
pMapStart->status = TS_INVALID;
@@ -44,7 +44,7 @@ namespace YAML
// key.required = true; // TODO: is this correct?
// then add the (now unverified) key
key.pKey = new Token(TT_KEY);
key.pKey = new Token(TT_KEY, INPUT.line, INPUT.column);
key.pKey->status = TS_UNVERIFIED;
m_tokens.push(key.pKey);