Disallowed a plain scalar with just a dash

This commit is contained in:
Jesse Beder
2012-01-11 16:39:24 -06:00
parent 5024caa69c
commit 97fa02a484
2 changed files with 13 additions and 3 deletions

View File

@@ -137,7 +137,7 @@ namespace YAML
// . In the block context - ? : must be not be followed with a space.
// . In the flow context ? is illegal and : and - must not be followed with a space.
inline const RegEx& PlainScalar() {
static const RegEx e = !(BlankOrBreak() || RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) || (RegEx("-?:", REGEX_OR) + Blank()));
static const RegEx e = !(BlankOrBreak() || RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) || (RegEx("-?:", REGEX_OR) + (BlankOrBreak() || RegEx())));
return e;
}
inline const RegEx& PlainScalarInFlow() {