mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fixed bug with omitted keys/values in a flow map
This commit is contained in:
@@ -37,7 +37,7 @@ namespace YAML
|
||||
const RegEx Key = RegEx('?'),
|
||||
KeyInFlow = RegEx('?') + BlankOrBreak;
|
||||
const RegEx Value = RegEx(':') + (BlankOrBreak || RegEx()),
|
||||
ValueInFlow = RegEx(':') + BlankOrBreak;
|
||||
ValueInFlow = RegEx(':') + (BlankOrBreak || RegEx(",}", REGEX_OR));
|
||||
const RegEx Comment = RegEx('#');
|
||||
const RegEx AnchorEnd = RegEx("?:,]}%@`", REGEX_OR) || BlankOrBreak;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace YAML
|
||||
const RegEx PlainScalar = !(BlankOrBreak || RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) || (RegEx("-?:", REGEX_OR) + Blank)),
|
||||
PlainScalarInFlow = !(BlankOrBreak || RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) || (RegEx("-:", REGEX_OR) + Blank));
|
||||
const RegEx EndScalar = RegEx(':') + (BlankOrBreak || RegEx()),
|
||||
EndScalarInFlow = (RegEx(':') + BlankOrBreak) || RegEx(",?[]{}", REGEX_OR);
|
||||
EndScalarInFlow = (RegEx(':') + (BlankOrBreak || RegEx(",]}", REGEX_OR))) || RegEx(",?[]{}", REGEX_OR);
|
||||
|
||||
const RegEx EscSingleQuote = RegEx("\'\'");
|
||||
const RegEx EscBreak = RegEx('\\') + Break;
|
||||
|
@@ -104,7 +104,7 @@ namespace YAML
|
||||
// *****
|
||||
// And now branch based on the next few characters!
|
||||
// *****
|
||||
|
||||
|
||||
// end of stream
|
||||
if(!INPUT)
|
||||
return EndStream();
|
||||
|
@@ -181,6 +181,12 @@ namespace YAML
|
||||
throw ParserException(INPUT.mark(), ErrorMsg::MAP_VALUE);
|
||||
|
||||
PushIndentTo(INPUT.column(), IndentMarker::MAP);
|
||||
} else {
|
||||
// we might have an empty key, so we should add it (as a simple key)
|
||||
if(m_simpleKeyAllowed) {
|
||||
InsertSimpleKey();
|
||||
VerifySimpleKey();
|
||||
}
|
||||
}
|
||||
|
||||
// can only put a simple key here if we're in block context
|
||||
|
Reference in New Issue
Block a user