Merge lp:~veebers/xpathselect/fix_for_colons_in_node_name_1281688 into lp:xpathselect

Proposed by Christopher Lee
Status: Merged
Approved by: Thomi Richards
Approved revision: 45
Merged at revision: 42
Proposed branch: lp:~veebers/xpathselect/fix_for_colons_in_node_name_1281688
Merge into: lp:xpathselect
Diff against target: 33 lines (+5/-2)
2 files modified
lib/parser.h (+1/-1)
test/test_parser.cpp (+4/-1)
To merge this branch: bzr merge lp:~veebers/xpathselect/fix_for_colons_in_node_name_1281688
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+207289@code.launchpad.net

Commit message

Node names can now contain colons (so names like Internal::MainWindow work). Tests added.

Description of the change

Node names can now contain colons (so names like Internal::MainWindow work). Tests added.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/parser.h'
2--- lib/parser.h 2013-09-03 03:28:14 +0000
3+++ lib/parser.h 2014-02-19 19:43:57 +0000
4@@ -134,7 +134,7 @@
5 // spec_node_name is a node name that has been explicitly specified.
6 // it must start and end with a non-space character, but you can have
7 // spaces in the middle.
8- spec_node_name = +qi::char_("a-zA-Z0-9_\\-") >> *(+qi::char_(" ") >> +qi::char_("a-zA-Z0-9_\\-"));
9+ spec_node_name = +qi::char_("a-zA-Z0-9_\\-") >> *(+qi::char_(" :") >> +qi::char_("a-zA-Z0-9_\\-"));
10 // a wildcard node name is simply a '*'
11 wildcard_node_name = qi::char_("*");
12
13
14=== modified file 'test/test_parser.cpp'
15--- test/test_parser.cpp 2013-09-03 03:28:14 +0000
16+++ test/test_parser.cpp 2014-02-19 19:43:57 +0000
17@@ -327,6 +327,7 @@
18 std::pair<std::string, bool>("node-name", true),
19 std::pair<std::string, bool>("node_name", true),
20 std::pair<std::string, bool>("node\\name", true),
21+ std::pair<std::string, bool>("node::name", false),
22 std::pair<std::string, bool>("node.name", false),
23 std::pair<std::string, bool>("node name", false),
24 std::pair<std::string, bool>("..", false)
25@@ -458,7 +459,9 @@
26 std::pair<std::string, bool>("1", true),
27 std::pair<std::string, bool>("node-name", true),
28 std::pair<std::string, bool>("node_name", true),
29- std::pair<std::string, bool>("node\\name", true)
30+ std::pair<std::string, bool>("node\\name", true),
31+ std::pair<std::string, bool>("node::name", true),
32+ std::pair<std::string, bool>("node::name::extra", true)
33 ));
34
35

Subscribers

People subscribed via source and target branches