This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PR 61424] std::regex matches right to left, not leftmost longest
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tim Shen <timshen91 at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 28 Jun 2014 10:45:05 +0100
- Subject: Re: [PR 61424] std::regex matches right to left, not leftmost longest
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDm1M5RotYKr4GLQ7i_=F8h-37vh2C2HJvrRNaoiXgQirA at mail dot gmail dot com> <20140610165427 dot GM30729 at redhat dot com> <CAPrifDk+8FDNFVQca0cxnrytDdtv9ifru6uqcGo+bnViYZyMUQ at mail dot gmail dot com> <CAPrifDnWns+QWcJgXe7Aw0NnTnLp4+UmwSL0hHcEhHhxXrDbdw at mail dot gmail dot com>
On 28/06/14 00:18 -0700, Tim Shen wrote:
diff --git a/libstdc++-v3/include/bits/regex_executor.h b/libstdc++-v3/include/bits/regex_executor.h
index 1991c00..e02fa65 100644
--- a/libstdc++-v3/include/bits/regex_executor.h
+++ b/libstdc++-v3/include/bits/regex_executor.h
@@ -173,6 +173,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void _M_queue(_StateIdT __i, const _ResultsVec& __res)
{ _M_match_queue.emplace_back(__i, __res); }
+ _BiIter* _M_get_sol_pos() { return nullptr; }
+
// Saves states that need to be considered for the next character.
vector<pair<_StateIdT, _ResultsVec>> _M_match_queue;
// Indicates which states are already visited.
@@ -191,12 +193,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Dummy implementations for DFS mode.
bool _M_visited(_StateIdT) const { return false; }
void _M_queue(_StateIdT, const _ResultsVec&) { }
+ _BiIter* _M_get_sol_pos() { return &_M_sol_pos; }
Please put a space above this new function, otherwise it looks like
the "Dummy implementations" comment applies to this function, but in
fact that function is used for dfs mode.
Similarly, maybe there should be a "Dummy implementation" comment on
the _State_info<__bfs, RV>::_M_get_sol_pos function.
OK with that change, thanks for the fix.