diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-11-12 15:59:58 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-11-13 17:30:25 +0300 |
commit | 861555876837449fd8fc480845f642dab4a68b1e (patch) | |
tree | 737992e719b5b5bee5574d3cba18e21b2ecbd912 /libbuild2/test/script | |
parent | 1dc4b29bb57b14bfd8f700be80224b6d865f0184 (diff) |
Use path_name in cc::lexer class
Diffstat (limited to 'libbuild2/test/script')
-rw-r--r-- | libbuild2/test/script/parser.cxx | 2 | ||||
-rw-r--r-- | libbuild2/test/script/script.hxx | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/libbuild2/test/script/parser.cxx b/libbuild2/test/script/parser.cxx index 376d68f..f3f6ffa 100644 --- a/libbuild2/test/script/parser.cxx +++ b/libbuild2/test/script/parser.cxx @@ -1028,7 +1028,7 @@ namespace build2 }; const path_name_value& pn (enter_path (move (n))); - const path& p (*pn.path); + const path& p (pn.path); if (include_set_->insert (p).second || !once) { diff --git a/libbuild2/test/script/script.hxx b/libbuild2/test/script/script.hxx index f4ef32a..73fd696 100644 --- a/libbuild2/test/script/script.hxx +++ b/libbuild2/test/script/script.hxx @@ -548,7 +548,19 @@ namespace build2 // Testscript file paths. Specifically, replay_token::file points to // these path names. // - std::set<path_name_value> paths_; + struct compare_paths + { + bool operator() (const path_name_value& x, + const path_name_value& y) const + { + // Note that these path names are always paths, so we compare them + // as paths. + // + return x.path < y.path; + } + }; + + std::set<path_name_value, compare_paths> paths_; }; } } |