mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 13:01:18 +00:00
Refactored simple keys so that validating doesn't require popping indents, and so popping indents (and adding the end map) is independent of when we validate the simple key
This commit is contained in:
@@ -36,10 +36,12 @@ namespace YAML
|
||||
private:
|
||||
struct IndentMarker {
|
||||
enum INDENT_TYPE { MAP, SEQ, NONE };
|
||||
IndentMarker(int column_, INDENT_TYPE type_): column(column_), type(type_) {}
|
||||
IndentMarker(int column_, INDENT_TYPE type_): column(column_), type(type_), isValid(true), pStartToken(0) {}
|
||||
|
||||
int column;
|
||||
INDENT_TYPE type;
|
||||
bool isValid;
|
||||
Token *pStartToken;
|
||||
};
|
||||
|
||||
private:
|
||||
@@ -49,7 +51,7 @@ namespace YAML
|
||||
void ScanToNextToken();
|
||||
void StartStream();
|
||||
void EndStream();
|
||||
Token *PushIndentTo(int column, IndentMarker::INDENT_TYPE type);
|
||||
IndentMarker *PushIndentTo(int column, IndentMarker::INDENT_TYPE type);
|
||||
void PopIndentToHere();
|
||||
void PopAllIndents();
|
||||
void PopIndent();
|
||||
@@ -71,6 +73,7 @@ namespace YAML
|
||||
|
||||
Mark mark;
|
||||
int flowLevel;
|
||||
IndentMarker *pIndent;
|
||||
Token *pMapStart, *pKey;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user