File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ inline const RegEx& URI() {
135135 return e;
136136}
137137inline const RegEx& Tag () {
138- static const RegEx e = Word () || RegEx (" #;/?:@&=+$_.~*'" , REGEX_OR) ||
138+ static const RegEx e = Word () || RegEx (" #;/?:@&=+$_.~*'() " , REGEX_OR) ||
139139 (RegEx (' %' ) + Hex () + Hex ());
140140 return e;
141141}
@@ -200,7 +200,7 @@ inline const RegEx& Chomp() {
200200
201201// and some functions
202202std::string Escape (Stream& in);
203- }
203+ } // namespace Exp
204204
205205namespace Keys {
206206const char Directive = ' %' ;
@@ -216,7 +216,7 @@ const char LiteralScalar = '|';
216216const char FoldedScalar = ' >' ;
217217const char VerbatimTagStart = ' <' ;
218218const char VerbatimTagEnd = ' >' ;
219- }
220- }
219+ } // namespace Keys
220+ } // namespace YAML
221221
222222#endif // EXP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
Original file line number Diff line number Diff line change @@ -230,6 +230,12 @@ TEST(NodeTest, LoadTildeAsNull) {
230230 Node node = Load (" ~" );
231231 ASSERT_TRUE (node.IsNull ());
232232}
233+
234+ TEST (NodeTest, LoadTagWithParenthesis) {
235+ Node node = Load (" !Complex(Tag) foo" );
236+ EXPECT_EQ (node.Tag (), " !Complex(Tag)" );
237+ EXPECT_EQ (node.as <std::string>(), " foo" );
238+ }
233239
234240} // namespace
235241} // namespace YAML
You can’t perform that action at this time.
0 commit comments