summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/regex_compiler.h
AgeCommit message (Collapse)Author
2017-06-07PR libstdc++/81002 fix std::basic_regex range constructorredi
PR libstdc++/81002 * include/bits/regex_compiler.h (__compile_nfa): Add template argument list to specify traits type. * testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@248991 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-01 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243994 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-01 PR libstdc++/71500timshen
* include/bits/regex.h (basic_regex::basic_regex): Use ECMAScript when the syntax is not specified. * include/bits/regex_compiler.h (_RegexTranslator, _RegexTranslatorBase): Partially support icase in ranges. * include/bits/regex_compiler.tcc (_BracketMatcher::_M_apply): Refactor _M_apply to make the control flow easier to follow, and call _M_translator._M_match_range as added previously. * testsuite/28_regex/traits/char/icase.cc: Add new tests. * testsuite/28_regex/traits/char/user_defined.cc: Add new tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243093 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-04 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232055 138bc75d-0d04-0410-961f-82ee72b054a4
2015-09-19 PR libstdc++/67361timshen
* include/bits/regex_error.h: Add __throw_regex_error that supports string. * include/bits/regex_automaton.h: Add more specific exception messages. * include/bits/regex_automaton.tcc: Likewise. * include/bits/regex_compiler.h: Likewise. * include/bits/regex_compiler.tcc: Likewise. * include/bits/regex_scanner.h: Likewise. * include/bits/regex_scanner.tcc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227936 138bc75d-0d04-0410-961f-82ee72b054a4
2015-09-07Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.hredi
* include/bits/regex_compiler.h (_BracketMatcher::_M_is_ready): Initialize using NSDMI and set using _GLIBCXX_DEBUG_ONLY. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227521 138bc75d-0d04-0410-961f-82ee72b054a4
2015-07-29 PR libstdc++/67015timshen
* include/bits/regex_compiler.h (_Compiler<>::_M_expression_term, _BracketMatcher<>::_M_add_collating_element): Change signature to make checking the and of bracket expression easier. * include/bits/regex_compiler.tcc (_Compiler<>::_M_expression_term): Treat '-' as a valid literal if it's at the end of bracket expression. * testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc: New testcases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226336 138bc75d-0d04-0410-961f-82ee72b054a4
2015-01-19 PR libstdc++/64584timshen
PR libstdc++/64585 * include/bits/regex.h (basic_regex<>::basic_regex, basic_regex<>::assign, basic_regex<>::imbue, basic_regex<>::swap, basic_regex<>::mark_count): Drop NFA after imbuing basic_regex; Make assign() transactional against exception. * include/bits/regex_compiler.h (__compile_nfa<>): Add back __compile_nfa SFINAE. * include/std/regex: Adjust include order to avoid __compile_nfa forward declaration. * testsuite/28_regex/basic_regex/assign/char/string.cc: New testcase. * testsuite/28_regex/basic_regex/imbue/string.cc: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219865 138bc75d-0d04-0410-961f-82ee72b054a4
2015-01-05 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219188 138bc75d-0d04-0410-961f-82ee72b054a4
2014-12-03 * include/bits/regex_compiler.h (_S_cache_size): Multiply thempolacek
RHS of the shift-expression by _UseCache::value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218322 138bc75d-0d04-0410-961f-82ee72b054a4
2014-11-13 PR libstdc++/63775timshen
* include/bits/regex_compiler.h (_Compiler<>::_M_expression_term, _BracketMatcher<>::_M_make_range): Throw regex_erorr on invalid range like [z-a]. Change _M_expression_term interface. * include/bits/regex_compiler.tcc ( _Compiler<>::_M_insert_bracket_matcher, _Compiler<>::_M_expression_term): Rewrite bracket expression parsing. * testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc: Add testcases and move file out of extended. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217461 138bc75d-0d04-0410-961f-82ee72b054a4
2014-09-25 PR libstdc++/63199timshen
* include/bits/regex.h (basic_regex::basic_regex, basic_regex::assign, basic_regex::imbue, basic_regex::getloc, basic_regex::swap): Add _M_loc for basic_regex. * include/bits/regex_automaton.h: Add _M_traits for _NFA. * include/bits/regex_compiler.h (_Compiler::_M_get_nfa, __compile_nfa): Make _Compiler::_M_nfa heap allocated. * include/bits/regex_compiler.tcc (_Compiler::_Compiler): Make _Compiler::_M_nfa heap allocated. * include/bits/regex_executor.h (_Executor::_M_is_word): Fix accessing _M_traits. * include/bits/regex_executor.tcc (_Executor::_M_dfs): Fix accessing _M_traits. * testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/63199.cc: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215578 138bc75d-0d04-0410-961f-82ee72b054a4
2014-09-11 PR libstdc++/63219redi
* include/bits/regex.h (match_results::format): Remove stray template parameter. * include/bits/regex_compiler.h (_RegexTranslator::_RegexTranslator): Remove parameter name to avoid -Wunused-parameter warning. * include/bits/regex_executor.h (_State_info::_State_info): Reorder mem-initializers to avoid -Wreorder warning. * include/bits/regex_executor.tcc (_Executor::_M_word_boundary): Remove parameter name to avoid -Wunused-parameter warning. * include/bits/regex_scanner.tcc (_Scanner::_M_advance): Add braces to avoid -Wempty-body warning when not in debug mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215160 138bc75d-0d04-0410-961f-82ee72b054a4
2014-06-02 * include/bits/regex_compiler.h (__detail::_BracketMatcher): Reorderredi
members to avoid wasted space when not using a cache. (__detail::_BracketMatcher::_M_ready()): Sort and deduplicate set. * include/bits/regex_compiler.tcc (__detail::_BracketMatcher::_M_apply(_CharT, false_type)): Use binary search on set. * include/bits/regex_executor.h (__detail::_Executor::_Match_mode): New enumeration type to indicate match mode. (__detail::_Executor::_State_info): New type holding members only needed in BFS-mode. Replace unique_ptr<vector<bool>> with unique_ptr<bool[]>. (__detail::_Executor::_M_rep_once_more, __detail::_Executor::_M_dfs): Replace template parameter with run-time function parameter. (__detail::_Executor::_M_main): Likewise. Dispatch to ... (__detail::_Executor::_M_main_dispatch): New overloaded functions to implement DFS and BFS mode. * include/bits/regex_executor.tcc (__detail::_Executor::_M_main): Split implementation into ... (__detail::_Executor::_M_main_dispatch): New overloaded functions. (__detail::_Executor::_M_lookahead): Create nested executor on stack. (__detail::_Executor::_M_rep_once_more): Pass match mode as function argument instead of template argument. (__detail::_Executor::_M_dfs): Likewise. * include/bits/regex_scanner.tcc: Fix typos in comments. * testsuite/performance/28_regex/range.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211143 138bc75d-0d04-0410-961f-82ee72b054a4
2014-05-202014-05-20 Tim Shen <timshen91@gmail.com>timshen
PR libstdc++/61227 * include/bits/regex_compiler.h (_BracketMatcher<>::_M_add_character_class): Add negative character class support. * include/bits/regex_compiler.tcc (_BracketMatcher<>::_M_apply): Likewise. * testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc: Add more testcases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210630 138bc75d-0d04-0410-961f-82ee72b054a4
2014-04-272014-04-27 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_automaton.h (_NFA<>::_M_insert_repeat): Add _S_opcode_repeat support to distingush a loop from _S_opcode_alternative. * include/bits/regex_automaton.tcc (_State_base::_M_print, _State_base::_M_dot, _NFA<>::_M_eliminate_dummy, _StateSeq<>::_M_clone): Likewise. * include/bits/regex_compiler.tcc (_Compiler<>::_M_quantifier): Likewise. * include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Likewise. * include/bits/regex_scanner.tcc (_Scanner<>::_M_eat_escape_ecma): Uglify local variable __i. * include/bits/regex_compiler.h (_BracketMatcher<>::_M_make_cache): Use size_t instead of int to compare with vector::size(). 2014-04-27 Tim Shen <timshen91@gmail.com> * include/bits/regex_executor.h: Add _M_rep_count to track how many times this repeat node are visited. * include/bits/regex_executor.tcc (_Executor<>::_M_rep_once_more, _Executor<>::_M_dfs): Use _M_rep_count to prevent entering infinite loop. 2014-04-27 Tim Shen <timshen91@gmail.com> * include/bits/regex.tcc (__regex_algo_impl<>): Remove _GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT and use _GLIBCXX_REGEX_USE_THOMPSON_NFA instead. * include/bits/regex_automaton.h: Remove quantifier counting variable. * include/bits/regex_automaton.tcc (_State_base::_M_dot): Adjust debug NFA dump. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209844 138bc75d-0d04-0410-961f-82ee72b054a4
2014-03-152014-03-15 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex.h: Add/modify comments. * include/bits/regex_compiler.h: Likewise. * include/bits/regex_executor.h: Likewise. * include/bits/regex_executor.tcc: Likewise. * include/bits/regex_scanner.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208593 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-192014-01-19 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_compiler.h (_Comipler<>::_M_quantifier()): Fix parse error of multiple consecutive quantifiers like "a**". * include/bits/regex_compiler.tcc (_Comipler<>::_M_quantifier()): Likewise. * testsuite/28_regex/basic_regex/multiple_quantifiers.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206783 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-162014-01-17 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_automaton.tcc (_StateSeq<>::_M_clone()): Do not use std::map. * include/bits/regex_automaton.h: Do not use std::set. * include/bits/regex_compiler.h (_BracketMatcher<>::_M_add_char(), _BracketMatcher<>::_M_add_collating_element(), _BracketMatcher<>::_M_add_equivalence_class(), _BracketMatcher<>::_M_make_range()): Likewise. * include/bits/regex_compiler.tcc (_BracketMatcher<>::_M_apply()): Likewise. * include/bits/regex_executor.h: Do not use std::queue. * include/bits/regex_executor.tcc (_Executor<>::_M_main(), _Executor<>::_M_dfs()): Likewise. * include/std/regex: Remove <map>, <set> and <queue>. 2014-01-17 Tim Shen <timshen91@gmail.com> * include/bits/regex.h (__compile_nfa<>(), basic_regex<>::basic_regex(), basic_regex<>::assign()): Change __compile_nfa to accept const _CharT* only. * include/bits/regex_compiler.h: Change _Compiler's template argument from <_FwdIter, _TraitsT> to <_TraitsT>. * include/bits/regex_compiler.tcc: Likewise. 2014-01-17 Tim Shen <timshen91@gmail.com> * include/bits/regex_compiler.h: Change _ScannerT into char-type templated. * include/bits/regex_scanner.h (_Scanner<>::_Scanner()): Separate _ScannerBase from _Scanner; Change _Scanner's template argument from _FwdIter to _CharT. Avoid use of std::map and std::set by using arrays instead. * include/bits/regex_scanner.tcc (_Scanner<>::_Scanner(), _Scanner<>::_M_scan_normal(), _Scanner<>::_M_eat_escape_ecma(), _Scanner<>::_M_eat_escape_posix(), _Scanner<>::_M_eat_escape_awk()): Likewise. * include/std/regex: Add <cstring> for using strchr. 2014-01-17 Tim Shen <timshen91@gmail.com> * bits/regex_automaton.tcc: Indentation fix. * bits/regex_compiler.h (__compile_nfa<>(), _Compiler<>, _RegexTranslator<> _AnyMatcher<>, _CharMatcher<>, _BracketMatcher<>): Add bool option template parameters and specializations to make matching more efficient and space saving. * bits/regex_compiler.tcc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206690 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-072014-01-07 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_compiler.h (_AnyMatcher<>::_AnyMatcher(), _AnyMatcher<>::operator(), _AnyMatcher<>::_M_apply(), _CharMatcher<>::_CharMatcher(), _CharMatcher<>::_M_translate(), _BracketMatcher<>::_BracketMatcher(), _BracketMatcher<>::operator(), _BracketMatcher<>::_M_add_char(), _BracketMatcher<>::_M_add_collating_element(), _BracketMatcher<>::_M_add_equivalence_class(), _BracketMatcher<>::_M_add_character_class(), _BracketMatcher<>::_M_make_range(), _BracketMatcher<>::_M_ready(), _BracketMatcher<>::_M_apply(), _BracketMatcher<>::_M_make_cache()): Fix _AnyMatcher behavior of POSIX style and move _M_flags to template parameter; Add cache for _BracketMatcher. Adjust declarations from here... * include/bits/regex.h (basic_regex<>::imbue()): ...to here. Also, imbuing a regex will trigger a recompilation to rebuild the cache. * include/bits/regex_compiler.tcc (_Compiler<>::_M_atom(), _Compiler<>::_M_bracket_expression()): Adjust matchers' caller for different template bool parameters. * include/bits/regex_executor.h: Remove unnecessary declarations. * include/std/regex: Adjust including orders. * testsuite/28_regex/traits/char/user_defined.cc: New. * testsuite/28_regex/traits/wchar_t/user_defined.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206400 138bc75d-0d04-0410-961f-82ee72b054a4
2014-01-02Update copyright years in libstdc++-v3/rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206301 138bc75d-0d04-0410-961f-82ee72b054a4
2013-12-032013-12-03 Tim Shen <timshen91@gmail.com>timshen
* regex_compiler.h: Add todo comment. * regex_executor.tcc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205624 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-08 * include/bits/regex_compiler.h (__detail::__has_contiguous_iter):redi
vector<bool> storage is not contiguous. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204582 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-08 * include/bits/regex_compiler.h (__detail::__compile_nfa): Overloadredi
so that std::basic_string<C> and std::vector<C> iterators dispatch to the const C* compiler. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204574 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-08 * include/bits/regex_compiler.h (__detail::_AnyMatcher,redi
__detail::_CharMatcher, __detail::_BracketMatcher): Remove redundant _CharT template parameters. * include/bits/regex_compiler.tcc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204573 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-08 * include/bits/regex_automaton.h (__detail::_State, __detail::_NFA,redi
__detail::_StateSeq): Remove redundant _CharT template parameters. * include/bits/regex_automaton.tcc: Likewise. * include/bits/regex_compiler.h (__detail::_Compiler): Likewise. (__compile_nfa): Add object generator for _Compiler. * include/bits/regex_compiler.tcc: Remove _CharT template parameters. * include/bits/regex_executor.h: Likewise. * include/bits/regex_executor.tcc: Likewise. * include/bits/regex.h (basic_regex): Assert char_type matches. Use __compile_nfa object generator. Remove _CharT template parameter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204572 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-08 * include/bits/regex_automaton.h (__detail::_State): Splitredi
non-dependent parts into new _State_base. (__detail::_NFA): Likewise for _NFA_base. Use std::move() to avoid copies when inserting _MatcherT and _StateT objects. * include/bits/regex_automaton.tcc: Move member definitions to base class. Qualify dependent names. * include/bits/regex_compiler.h (__detail::_Compiler::_M_get_nfa): Make non-const and use std::move to avoid copying. * include/bits/regex_compiler.tcc: Likewise. * include/bits/regex_executor.h (__detail::_Executor::_M_is_word): Use array, so past-the-end iterator is valid. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204571 138bc75d-0d04-0410-961f-82ee72b054a4
2013-10-172013-10-17 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex.h (regex_token_iterator<>::regex_token_iterator): Fix initialization orders in initialization list and add explicit braces for potentially ambiguous(actually not) `else` branch to eliminate warnings. * include/bits/regex_automaton.h (_NFA<>::_NFA): Likewise. * include/bits/regex_compiler.h (_CharMatcher<>::_CharMatcher, _BracketMatcher<>::_BracketMatcher): Likewise. * include/bits/regex_compiler.tcc (_Compiler<>::_Compiler, _Compiler<>::_M_atom): Likewise. * include/bits/regex_executor.h (_Executor<>::_Executor): Likewise. * include/bits/regex_executor.tcc (_DFSExecutor<>::_M_dfs, _Executor<>::_M_word_boundry): Likewise. * include/bits/regex_scanner.tcc (_Scanner<>::_Scanner, _Scanner<>::_M_eat_class): Likewise. * include/bits/regex.tcc (__regex_algo_impl<>, regex_iterator<>::operator++): Likewise, and remove unused typedef. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203798 138bc75d-0d04-0410-961f-82ee72b054a4
2013-10-022013-10-02 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_compiler.h (_BracketMatcher<>::_M_add_equivalence_class): Implement it correctly. * include/bits/regex_compiler.tcc (_BracketMatcher<>::operator()): Add _M_equiv_set support. * testsuite/28_regex/algorithms/regex_match/extended/ cstring_bracket_01.cc: Add new "[[=a=]]" testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203117 138bc75d-0d04-0410-961f-82ee72b054a4
2013-09-242013-09-24 Tim Shen <timshen91@gmail.com>timshen
* include/Makefile.am: Add regex.tcc. * include/Makefile.in: Regenerate. * include/bits/regex.h: Remove definitions to regex.tcc. * include/bits/regex.tcc: New. (match_results::format, regex_replace): Implement; * include/bits/regex_compiler.h: Move _M_flags to the top of class member list, because other members' initialization depend on it. * include/bits/regex_compiler.tcc (_Compiler<>::_Compiler): Adjust member initializations. (_Compiler<>::_M_quantifier): Fix ungreedy interval quantifier. * include/bits/regex_executor.h: Remove _RegexT from _*Executor classes. In the future, all regex classes may refactor to *Impl style. * include/bits/regex_executor.tcc (_Executor::_M_set_results): Merge identical code from _*Executor classes. * testsuite/28_regex/algorithms/regex_match/extended/ string_dispatch_01.cc (fake_match<>): Adjust the hacking-style testcase caller for new __get_executors interface. * testsuite/28_regex/algorithms/regex_replace/char/basic_replace.cc: New. * testsuite/28_regex/match_results/format.cc: New. * testsuite/28_regex/traits/char/lookup_collatename.cc: Remove digraph testcase. * testsuite/28_regex/traits/wchar_t/lookup_collatename.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202858 138bc75d-0d04-0410-961f-82ee72b054a4
2013-09-142013-09-14 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex.h (regex_match<>, regex_search<>): Change regex_executor caller. Now use their return value instead of checking __m[0].matched to find out if it's successful. (regex_search<>): Move the search logic to regex_executor. * include/bits/regex_automaton.h: Add some new _Opcode. Refactor _NFA::_M_insert_*. * include/bits/regex_automaton.tcc: Add DEBUG dump for new _Opcode. Refactor _NFA::_M_insert_*. * include/bits/regex_compiler.h (_Compiler<>::_M_get_nfa): Use make_shared instead of construct by hand. * include/bits/regex_compiler.tcc: Implement _Compiler<>::_M_assertion. * include/bits/regex_constants.h: Fix indentation and line breaking. * include/bits/regex_executor.h: Add _ResultsEntry to support greedy/ungreedy mode. Move regex_search logic here. * include/bits/regex_executor.tcc: Implement assertions and greedy/ungreedy matching. * include/bits/regex_scanner.h: Add a new token _S_token_ungreedy. * include/bits/regex_scanner.tcc: Parse a new token _S_token_ungreedy. * testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc: New. * testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: New. * testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc: Fix comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202591 138bc75d-0d04-0410-961f-82ee72b054a4
2013-09-052013-09-05 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex_automaton.h: Add dummy node type. Rewrite _StateSeq. * include/bits/regex_automaton.tcc: Implement them. * include/bits/regex_compiler.h: Rewrite _Compiler to use new _StateSeq interfaces. * include/bits/regex_compiler.tcc: Implement them. * include/bits/regex_scanner.h: Add word boundry assertion token. * include/bits/regex_scanner.tcc (_Scanner<>::_M_eat_escape_ecma): Support word boundry. * testsuite/28_regex/algorithms/regex_match/basic/ string_range_02_03.cc: Remove "xfail". * testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc: Likewise. * testsuite/28_regex/algorithms/regex_match/extended/ string_range_02_03.cc: Likewise. * testsuite/28_regex/algorithms/regex_match/extended/ cstring_questionmark.cc: Remove xfail and get correct length of c-string. * testsuite/28_regex/algorithms/regex_match/extended/ string_range_00_03.cc: Likewise. * testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc: New. * testsuite/28_regex/algorithms/regex_match/extended/cstring_range.cc: New. * testsuite/28_regex/iterators/regex_iterator/wchar_t/string_02.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202290 138bc75d-0d04-0410-961f-82ee72b054a4
2013-09-022013-09-02 Tim Shen <timshen91@gmail.com>timshen
* regex_automaton.h: Rearrange _NFA's layout. * include/bits/regex_compiler.h: Add _AnyMatcher and _CharMatcher. Rearrange _BracketMatcher's layout. (_BracketMatcher<>::_M_add_char): Use set instead of vector for _M_char_set. (_BracketMatcher<>::_M_add_collating_element): Likewise. (_BracketMatcher<>::_M_make_range): Likewise. * include/bits/regex_compiler.tcc (_Compiler<>::_M_atom): Use apropriate constructors of matchers above. * testsuite/28_regex/algorithms/regex_match/ecma/char/anymatcher.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/char/backref.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/char/empty_range.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/char/emptygroup.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/char/hex.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/anymatcher.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202189 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-292013-08-29 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex.h (basic_regex<>::assign): Don't lose _M_traits. (regex_iterator<>::regex_iterator): Return nullptr when regex_search failed. (regex_token_iterator<>::_M_end_of_seq): Should be defined true when _M_result is(not isn't) nullptr. * include/bits/regex_compiler.h: Store _Compiler::_M_traits by reference instead of by value. * include/bits/regex_executor.h (_DFSExecutor<>::_DFSExecutor): Add _M_traits to _DFSExecutor. * include/bits/regex_executor.tcc (__get_executor<>): Pass traits to _DFSExecutor too. * testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc: New. * testsuite/28_regex/iterators/regex_token_iterator/wchar_t/ wstring_02.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202082 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-272013-08-26 Tim Shen <timshen91@gmail.com>timshen
* include/Makefile.am: Add regex_scanner.{h,tcc}. * include/Makefile.in: Regenerate. * include/bits/regex.h (match_search): Handle the `__first == __last` situation correctly. * include/bits/regex_compiler.h: Move _Scanner... * include/bits/regex_scanner.h: ...to here. New. * include/bits/regex_compiler.tcc: Move _Scanner... * include/bits/regex_scanner.tcc: ...to here, too. New. * include/bits/regex_executor.tcc: Use value instead of reference for submatch. * include/std/regex: Add regex_scanner.h * testsuite/28_regex/algorithms/regex_match/awk/cstring_01.cc: New. * testsuite/28_regex/algorithms/regex_match/basic/empty_range.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/cstring_hex.cc: New. * testsuite/28_regex/algorithms/regex_match/ecma/empty_range.cc: New. * testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202015 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-222013-08-22 Tim Shen <timshen91@gmail.com>timshen
* include/bits/regex.h: Replace 8 spaces in indentation with a tab. * include/bits/regex_automaton.h: Same. * include/bits/regex_automaton.tcc: Same. * include/bits/regex_compiler.h: Same. * include/bits/regex_compiler.tcc: Same. * include/bits/regex_constants.h: Same. * include/bits/regex_executor.h: Same. * include/bits/regex_executor.tcc: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201916 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-072013-08-07 Tim Shen <timshen91@gmail.com>timshen
* include/Makefile.am: Adjust to new files. * include/Makefile.in: Regenerate. * include/bits/regex.h: Adjust to new interfaces. * include/bits/regex_automaton.h: New. * include/bits/regex_automaton.tcc: New. * include/bits/regex_compiler.h: Adjust to new files. * include/bits/regex_compiler.tcc: New. * include/bits/regex_constants.h: Tail spaces. * include/bits/regex_error.h: Likewise. * include/bits/regex_executor.h: New. * include/bits/regex_executor.tcc: New. * include/std/regex: Adjust to new files. * testsuite/28_regex/algorithms/regex_match/extended/ string_dispatch_01.cc: Adjust to new interfaces. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201573 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-032013-08-03 Tim Shen <timshen91@gmail.com>timshen
Implement bracket expression. * include/bits/regex.h: Remove constexpr from "|=", etc. * include/bits/regex_compiler.h: Parse bracket expression. * include/bits/regex_nfa.h: _Comparator and _BracketMatcher(old _RangeMatcher). * include/bits/regex_nfa.tcc: Implement them. * testsuite/28_regex/algorithms/regex_match/extended/53622.cc: from regex_search to regex_match. * testsuite/28_regex/algorithms/regex_match/extended/ cstring_bracket_01.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201465 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-312013-07-31 Tim Shen <timshen91@gmail.com>timshen
Thompson matcher refactored. Fix grouping problem. * include/bits/regex.h: Use a dispatcher _M_get_matcher(). * include/bits/regex_compiler.h: Tweak for auto switching. * include/bits/regex_grep_matcher.h: Class structure. * include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson matcher) refactoring. * include/bits/regex_nfa.h: Change _Results's interfaces. * include/std/regex: Includes <map> and <queue>. * testsuite/28_regex/algorithms/regex_match/extended/53622.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/57173.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/ string_dispatch_01.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201391 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-31 Revert last commit.timshen
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201360 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-312013-07-31 Tim Shen <timshen91@gmail.com>timshen
Thompson matcher refactored. Fix grouping problem. * include/bits/regex.h: Use a dispatcher _M_get_matcher(). * include/bits/regex_compiler.h: Tweak for auto switching. * include/bits/regex_grep_matcher.h: Class structure. * include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson matcher) refactoring. * include/bits/regex_nfa.h: Change _Results's interfaces. * include/std/regex: Includes <map> and <queue>. * testsuite/28_regex/algorithms/regex_match/extended/53622.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/57173.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/ string_dispatch_01.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201358 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-302013-07-30 Paolo Carlini <paolo.carlini@oracle.com>paolo
Revert last commit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201348 138bc75d-0d04-0410-961f-82ee72b054a4
2013-07-302013-07-30 Tim Shen <timshen91@gmail.com>timshen
Thompson matcher refactored. Fix grouping problem. * include/bits/regex.h: Use a dispatcher _M_get_matcher(). * include/bits/regex_compiler.h: Tweak for auto switching. * include/bits/regex_grep_matcher.h: Class structure. * include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson matcher) refactoring. * include/bits/regex_nfa.h: Change _Results's interfaces. * include/std/regex: Includes <map> and <queue>. * testsuite/28_regex/algorithms/regex_match/extended/53622.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/57173.cc: For both matchers. * testsuite/28_regex/algorithms/regex_match/extended/string_dispatch_01.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201334 138bc75d-0d04-0410-961f-82ee72b054a4
2013-02-03Update copyright in libstdc++-v3.rsandifo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195701 138bc75d-0d04-0410-961f-82ee72b054a4
2012-06-282012-06-27 Benjamin Kosnik <bkoz@redhat.com>bkoz
* include/bits/c++config: Remove __regex nested namespace. * include/bits/regex_compiler.h: Change __regex to __detail. Adjust doxygen markup, add regex-details group. * include/bits/regex_constants.h: Same. * include/bits/regex_cursor.h: Same. * include/bits/regex_error.h: Same. * include/bits/regex_grep_matcher.h: Same. * include/bits/regex_grep_matcher.tcc: Same. * include/bits/regex_nfa.h: Same. * include/bits/regex_nfa.tcc: Same. * include/bits/regex.h: Same. Remove static from global constants. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers. * include/bits/locale_classes.tcc: Add use_facet, has_facet to locales group. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189039 138bc75d-0d04-0410-961f-82ee72b054a4
2011-03-152011-03-14 Benjamin Kosnik <bkoz@redhat.com>bkoz
* src/Makefile.am: Add functional.cc, shared_ptr.cc. * src/Makefile.in: Regenerate. * libsupc++/Makefile.am: Add nested_exception.cc. * libsupc++/Makefile.in: Regenerate. * src/system_error.cc: Add ctor and dtor definitions for error_category. * src/functional.cc: New. Add dtor definition for bad_function_call. * src/stdexcept.cc: Add dtor definitions for domain_error, invalid_argument, length_error, out_of_range, range_error, overflow_error, underflow_error. * src/future.cc: Add dtor definition for __future_base::_Result_base. * src/shared_ptr.cc: New. Add dtor definition for bad_weak_ptr. * src/thread.cc: Add dtor for thread::_Impl_base. * include/std/system_error: Adjust. * include/std/stdexcept: Same. * include/std/future: Same. * include/std/functional: Same. * include/std/thread: Same. * include/bits/shared_ptr_base.h: Same. * libsupc++/nested_exception.cc: New. Add dtor for nested_exception. * libsupc++/nested_exception.h: Adjust. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * config/abi/pre/gnu.ver: Add new exports. * include/bits/regex_compiler.h: Nest namespace versioning. * include/bits/regex_grep_matcher.tcc: Same. * include/bits/regex_grep_matcher.h: Same. * include/bits/regex_cursor.h: Same. * include/bits/regex_nfa.h: Same. * include/bits/regex_nfa.tcc: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170975 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-172011-02-17 Jonathan Wakely <jwakely.gcc@gmail.com>redi
PR libstdc++/47724 * include/bits/regex_compiler.h (_Scanner::_M_advance): Do not treat line anchors as metacharacters. * testsuite/28_regex/basic_regex/ctors/47724.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170236 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-142011-02-14 Jonathan Wakely <jwakely.gcc@gmail.com>redi
* include/bits/regex.h (sub_match::sub_match): Add. (match_results::ready): Add. (match_results::empty): Adjust. (match_results::length): Add missing dereference. (match_results::operator[],prefix,suffix): Add debug mode checks. (match_results::cend): Re-use end(). (match_results::format): Adjust signatures. (operator==(match_results,match_results)): Implement. * include/bits/regex_compiler.h (_Scanner_base): Use constexpr. * include/bits/regex_constants.h (syntax_option_type): Likewise. * include/bits/regex_grep_matcher.h: Fix comment typo. (_Specialized_results::_Specialized_results): Simplify. * include/bits/regex_cursor.h: Fix comment typo. * include/bits/regex_nfa.h: Likewise. * testsuite/28_regex/basic_regex/ctors/basic/string_range_01_02_03.cc: Fix error code, remove xfail. * testsuite/28_regex/basic_regex/ctors/extended/ string_range_01_02_03.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170158 138bc75d-0d04-0410-961f-82ee72b054a4
2011-02-142011-02-14 Jonathan Wakely <jwakely.gcc@gmail.com>redi
* include/bits/regex_compiler.h: Remove unnecessary bind() calls. * include/bits/regex_nfa.h: Remove unnecessary base classes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170124 138bc75d-0d04-0410-961f-82ee72b054a4
2011-01-302011-01-30 Benjamin Kosnik <bkoz@redhat.com>bkoz
PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169421 138bc75d-0d04-0410-961f-82ee72b054a4