generate the Exp::CR() to support the escape of CR.
This commit is contained in:
parent
a03368ad20
commit
af1cc6c549
@ -176,11 +176,11 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
|
||||
static const RegEx& disallowed_flow =
|
||||
Exp::EndScalarInFlow() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
||||
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
||||
Exp::Tab();
|
||||
Exp::Tab() | Exp::CR();
|
||||
static const RegEx& disallowed_block =
|
||||
Exp::EndScalar() | (Exp::BlankOrBreak() + Exp::Comment()) |
|
||||
Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() |
|
||||
Exp::Tab();
|
||||
Exp::Tab() | Exp::CR();
|
||||
const RegEx& disallowed =
|
||||
flowType == FlowType::Flow ? disallowed_flow : disallowed_block;
|
||||
|
||||
|
||||
@ -32,6 +32,10 @@ inline const RegEx& Tab() {
|
||||
static const RegEx e = RegEx('\t');
|
||||
return e;
|
||||
}
|
||||
inline const RegEx& CR() {
|
||||
static const RegEx e = RegEx('\r');
|
||||
return e;
|
||||
}
|
||||
inline const RegEx& Blank() {
|
||||
static const RegEx e = Space() | Tab();
|
||||
return e;
|
||||
@ -69,7 +73,7 @@ inline const RegEx& Hex() {
|
||||
inline const RegEx& NotPrintable() {
|
||||
static const RegEx e =
|
||||
RegEx(0) |
|
||||
RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x7F", REGEX_OR) |
|
||||
RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x7F", REGEX_OR) |
|
||||
RegEx(0x0E, 0x1F) |
|
||||
(RegEx('\xC2') + (RegEx('\x80', '\x84') | RegEx('\x86', '\x9F')));
|
||||
return e;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user