diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-07-08 15:54:05 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-07-08 15:54:05 +0000 |
commit | fc7be18c76af2e700641f3598c4856baeef1428e (patch) | |
tree | 11dbca45eb321c3a4dd08b12152acc6ef5dd3fa9 /contrib/libs/yaml-cpp/src/exp.h | |
parent | ec0e7ed6da6fb317741fd8468602949a1362eca5 (diff) | |
parent | c92cb9d3a19331916f0c274d80e67f02a62caa9b (diff) | |
download | ydb-fc7be18c76af2e700641f3598c4856baeef1428e.tar.gz |
Merge branch 'rightlib' into mergelibs-240708-1553
Diffstat (limited to 'contrib/libs/yaml-cpp/src/exp.h')
-rw-r--r-- | contrib/libs/yaml-cpp/src/exp.h | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/contrib/libs/yaml-cpp/src/exp.h b/contrib/libs/yaml-cpp/src/exp.h index 50b0220b81..c8837f0f82 100644 --- a/contrib/libs/yaml-cpp/src/exp.h +++ b/contrib/libs/yaml-cpp/src/exp.h @@ -33,15 +33,15 @@ inline const RegEx& Tab() { return e; } inline const RegEx& Blank() { - static const RegEx e = Space() || Tab(); + static const RegEx e = Space() | Tab(); return e; } inline const RegEx& Break() { - static const RegEx e = RegEx('\n') || RegEx("\r\n"); + static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r'); return e; } inline const RegEx& BlankOrBreak() { - static const RegEx e = Blank() || Break(); + static const RegEx e = Blank() | Break(); return e; } inline const RegEx& Digit() { @@ -49,29 +49,29 @@ inline const RegEx& Digit() { return e; } inline const RegEx& Alpha() { - static const RegEx e = RegEx('a', 'z') || RegEx('A', 'Z'); + static const RegEx e = RegEx('a', 'z') | RegEx('A', 'Z'); return e; } inline const RegEx& AlphaNumeric() { - static const RegEx e = Alpha() || Digit(); + static const RegEx e = Alpha() | Digit(); return e; } inline const RegEx& Word() { - static const RegEx e = AlphaNumeric() || RegEx('-'); + static const RegEx e = AlphaNumeric() | RegEx('-'); return e; } inline const RegEx& Hex() { - static const RegEx e = Digit() || RegEx('A', 'F') || RegEx('a', 'f'); + static const RegEx e = Digit() | RegEx('A', 'F') | RegEx('a', 'f'); return e; } // Valid Unicode code points that are not part of c-printable (YAML 1.2, sec. // 5.1) inline const RegEx& NotPrintable() { static const RegEx e = - RegEx(0) || - 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'))); + RegEx(0) | + 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; } inline const RegEx& Utf8_ByteOrderMark() { @@ -82,19 +82,19 @@ inline const RegEx& Utf8_ByteOrderMark() { // actual tags inline const RegEx& DocStart() { - static const RegEx e = RegEx("---") + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& DocEnd() { - static const RegEx e = RegEx("...") + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& DocIndicator() { - static const RegEx e = DocStart() || DocEnd(); + static const RegEx e = DocStart() | DocEnd(); return e; } inline const RegEx& BlockEntry() { - static const RegEx e = RegEx('-') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& Key() { @@ -106,36 +106,40 @@ inline const RegEx& KeyInFlow() { return e; } inline const RegEx& Value() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& ValueInFlow() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx(",}", REGEX_OR)); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR)); return e; } inline const RegEx& ValueInJSONFlow() { static const RegEx e = RegEx(':'); return e; } +inline const RegEx& Ampersand() { + static const RegEx e = RegEx('&'); + return e; +} inline const RegEx Comment() { static const RegEx e = RegEx('#'); return e; } inline const RegEx& Anchor() { - static const RegEx e = !(RegEx("[]{},", REGEX_OR) || BlankOrBreak()); + static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak()); return e; } inline const RegEx& AnchorEnd() { - static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) || BlankOrBreak(); + static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak(); return e; } inline const RegEx& URI() { - static const RegEx e = Word() || RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) || + static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) | (RegEx('%') + Hex() + Hex()); return e; } inline const RegEx& Tag() { - static const RegEx e = Word() || RegEx("#;/?:@&=+$_.~*'", REGEX_OR) || + static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) | (RegEx('%') + Hex() + Hex()); return e; } @@ -148,34 +152,34 @@ inline const RegEx& Tag() { // space. inline const RegEx& PlainScalar() { static const RegEx e = - !(BlankOrBreak() || RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) || - (RegEx("-?:", REGEX_OR) + (BlankOrBreak() || RegEx()))); + !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) | + (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx()))); return e; } inline const RegEx& PlainScalarInFlow() { static const RegEx e = - !(BlankOrBreak() || RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) || - (RegEx("-:", REGEX_OR) + Blank())); + !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) | + (RegEx("-:", REGEX_OR) + (Blank() | RegEx()))); return e; } inline const RegEx& EndScalar() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& EndScalarInFlow() { static const RegEx e = - (RegEx(':') + (BlankOrBreak() || RegEx() || RegEx(",]}", REGEX_OR))) || + (RegEx(':') + (BlankOrBreak() | RegEx() | RegEx(",]}", REGEX_OR))) | RegEx(",?[]{}", REGEX_OR); return e; } inline const RegEx& ScanScalarEndInFlow() { - static const RegEx e = (EndScalarInFlow() || (BlankOrBreak() + Comment())); + static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment())); return e; } inline const RegEx& ScanScalarEnd() { - static const RegEx e = EndScalar() || (BlankOrBreak() + Comment()); + static const RegEx e = EndScalar() | (BlankOrBreak() + Comment()); return e; } inline const RegEx& EscSingleQuote() { @@ -192,15 +196,15 @@ inline const RegEx& ChompIndicator() { return e; } inline const RegEx& Chomp() { - static const RegEx e = (ChompIndicator() + Digit()) || - (Digit() + ChompIndicator()) || ChompIndicator() || + static const RegEx e = (ChompIndicator() + Digit()) | + (Digit() + ChompIndicator()) | ChompIndicator() | Digit(); return e; } // and some functions std::string Escape(Stream& in); -} +} // namespace Exp namespace Keys { const char Directive = '%'; @@ -216,7 +220,7 @@ const char LiteralScalar = '|'; const char FoldedScalar = '>'; const char VerbatimTagStart = '<'; const char VerbatimTagEnd = '>'; -} -} +} // namespace Keys +} // namespace YAML #endif // EXP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 |