diff --git a/src/exp.h b/src/exp.h index 50b0220..7c02cf6 100644 --- a/src/exp.h +++ b/src/exp.h @@ -135,7 +135,7 @@ inline const RegEx& URI() { 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; } @@ -200,7 +200,7 @@ inline const RegEx& Chomp() { // and some functions std::string Escape(Stream& in); -} +} // namespace Exp namespace Keys { const char Directive = '%'; @@ -216,7 +216,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 diff --git a/test/integration/load_node_test.cpp b/test/integration/load_node_test.cpp index ff0a3ae..02bb8fe 100644 --- a/test/integration/load_node_test.cpp +++ b/test/integration/load_node_test.cpp @@ -230,6 +230,12 @@ TEST(NodeTest, LoadTildeAsNull) { Node node = Load("~"); ASSERT_TRUE(node.IsNull()); } + +TEST(NodeTest, LoadTagWithParenthesis) { + Node node = Load("!Complex(Tag) foo"); + EXPECT_EQ(node.Tag(), "!Complex(Tag)"); + EXPECT_EQ(node.as(), "foo"); +} } // namespace } // namespace YAML