Fixed several bugs from the new file i/o setup.

In particular:
1. Windows CR/LF weren't read properly (issue #11)
2. Scanning wasn't reading EOF properly
3. Documents may be empty (this was old, I think)
Also fixed some VS2008 warnings on /W4.
This commit is contained in:
Jesse Beder
2009-02-07 07:57:13 +00:00
parent f9c0725684
commit 9d0e0c6a48
13 changed files with 85 additions and 63 deletions

View File

@@ -28,7 +28,7 @@ namespace YAML
// ********************************
// Phase #1: scan until line ending
while(!params.end.Matches(INPUT) && !Exp::Break.Matches(INPUT)) {
if(INPUT.peek() == EOF)
if(!INPUT)
break;
// document indicator?
@@ -60,7 +60,7 @@ namespace YAML
}
// eof? if we're looking to eat something, then we throw
if(INPUT.peek() == EOF) {
if(!INPUT) {
if(params.eatEnd)
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::EOF_IN_SCALAR);
break;