mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Moved the simple key validation to before each token scan (plus at newlines of scalars).
This commit is contained in:
@@ -16,6 +16,8 @@ namespace YAML
|
||||
Scanner(std::istream& in);
|
||||
~Scanner();
|
||||
|
||||
Token *GetNextToken();
|
||||
|
||||
void ScanNextToken();
|
||||
void ScanToNextToken();
|
||||
Token *PushIndentTo(int column, bool sequence);
|
||||
@@ -55,12 +57,12 @@ namespace YAML
|
||||
};
|
||||
|
||||
struct SimpleKey {
|
||||
SimpleKey(int pos_, int line_, int column_);
|
||||
SimpleKey(int pos_, int line_, int column_, int flowLevel_);
|
||||
|
||||
void Validate();
|
||||
void Invalidate();
|
||||
|
||||
int pos, line, column;
|
||||
int pos, line, column, flowLevel;
|
||||
bool required;
|
||||
Token *pMapStart, *pKey;
|
||||
};
|
||||
@@ -81,6 +83,7 @@ namespace YAML
|
||||
bool m_startedStream, m_endedStream;
|
||||
bool m_simpleKeyAllowed;
|
||||
int m_flowLevel; // number of unclosed '[' and '{' indicators
|
||||
bool m_isLastKeyValid;
|
||||
std::stack <SimpleKey> m_simpleKeys;
|
||||
std::stack <int> m_indents;
|
||||
};
|
||||
|
Reference in New Issue
Block a user