Centralized the error messages to one location.

This commit is contained in:
beder
2008-07-08 20:31:48 +00:00
parent 84bcdda342
commit 0b2e0dd32b
9 changed files with 71 additions and 46 deletions

View File

@@ -35,7 +35,7 @@ namespace YAML
if(params.onDocIndicator == BREAK)
break;
else if(params.onDocIndicator == THROW)
throw ParserException(INPUT.line, INPUT.column, "illegal document indicator in scalar");
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::DOC_IN_SCALAR);
}
foundNonEmptyLine = true;
@@ -61,7 +61,7 @@ namespace YAML
// eof? if we're looking to eat something, then we throw
if(INPUT.peek() == EOF) {
if(params.eatEnd)
throw ParserException(INPUT.line, INPUT.column, "illegal EOF in scalar");
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::EOF_IN_SCALAR);
break;
}
@@ -97,7 +97,7 @@ namespace YAML
while(Exp::Blank.Matches(INPUT)) {
// we check for tabs that masquerade as indentation
if(INPUT.peek() == '\t'&& INPUT.column < params.indent && params.onTabInIndentation == THROW)
throw ParserException(INPUT.line, INPUT.column, "illegal tab when looking for indentation");
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::TAB_IN_INDENTATION);
if(!params.eatLeadingWhitespace)
break;