mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user