Moved the input stream, together with line/column info, into its own class, which allowed some other stuff just to pass the stream, and not have to be a member of Scanner.

This commit is contained in:
Jesse Beder 2008-06-29 06:32:13 +00:00
parent 0d5a97bffe
commit ff99f85a6d
13 changed files with 162 additions and 142 deletions

View file

@ -34,10 +34,10 @@ namespace YAML
// and saves it on a stack.
void Scanner::InsertSimpleKey()
{
SimpleKey key(INPUT.tellg(), m_line, m_column, m_flowLevel);
SimpleKey key(INPUT.pos(), INPUT.line, INPUT.column, m_flowLevel);
// first add a map start, if necessary
key.pMapStart = PushIndentTo(m_column, false);
key.pMapStart = PushIndentTo(INPUT.column, false);
if(key.pMapStart)
key.pMapStart->isValid = false;
// else
@ -79,7 +79,7 @@ namespace YAML
isValid = false;
// also needs to be less than 1024 characters and inline
if(m_line != key.line || (int) INPUT.tellg() - key.pos > 1024)
if(INPUT.line != key.line || INPUT.pos() - key.pos > 1024)
isValid = false;
// invalidate key