summaryrefslogtreecommitdiff
path: root/src/regex.hh
AgeCommit message (Collapse)Author
2024-03-22Make CompiledRegex not a RefCountableMaxime Coste
Keep this closer to the point of use, avoid pull ref_ptr.hpp into regex_impl.hpp
2023-11-13Quote completions of regex optionsJohannes Altmanninger
Recent changes to `make_error_pattern` added a space to the default value. This means that set g make_error_pattern <tab> now produces an invalid command because regexes are not quoted. We do quote strings; regexes are not all that different so quote them too.
2023-10-25Default comparison operators that can beMaxime Coste
2023-10-25Remove redundant comparison operatorsMaxime Coste
Since C++20 (a != b) get automatically rewritten as !(a == b) if the != operator does not exist.
2023-05-21Add an idle callback to be called regularly while regex matchingMaxime Coste
This paves the way towards being able to cancel long regex matching operations
2023-01-23Fix incorrect use of subject end/begin in regex executionMaxime Coste
This could lead to reading past subject string end in certain conditions Fixes #4794
2022-11-20Change BufferIterator comparison to assert same bufferMaxime Coste
Comparing iterators between buffers should never happen, and the only place we did was with default constructed BufferIterator which we replace by casting the iterator to bool. This should improve performance on iterator heavy code.
2022-05-21Stop using deprecated std::iteratorJohannes Altmanninger
As reported in #4615 and others, GCC 12.1 emits deprecation warnings because we use std::iterator. Replace it with the modern equivalent. Closes #4615
2019-01-20Split compile time regex flags from runtime onesMaxime Coste
2019-01-20Support re-using the same ThreadedRegexVM for multiple iterationsMaxime Coste
This should reduce the number of allocations as the memory allocated for the thread stack and the saves can be re-used between runs instead of being cleared every time.
2019-01-20Refactor RegexIterator to use a SentinelMaxime Coste
2019-01-03Add support for named captures to the regex impl and regex highlighterMaxime Coste
ECMAScript is adding support for it, and it is a pretty isolated change to do. Fixes #2293
2018-05-27Refactor option_from_string to return directly the option valueMaxime Coste
2018-04-25Refactor RegexIterator::next to directly use a ThreadedRegexVMMaxime Coste
2018-03-05Regex: take the full subject range as a parameterMaxime Coste
To allow more general look arounds out of the actual search range, pass a second range (the actual subject). This allows us to remove various flags such as PrevAvailable or NotBeginOfSubject, which are now easy to check from the subject range. Fixes #1902
2018-03-05Regex: Remove helper functions from regex_impl.hhMaxime Coste
They were close duplicates from the ones in regex.hh and not used anywhere else.
2017-12-29Correctly set the NotBeginOfSubject/NotEndOfSubject flags for regex matchingMaxime Coste
Fixes #1778
2017-12-03Regex: Introduce backward_regex_search helper functionMaxime Coste
2017-12-02Regex: make RegexIterator iterable and able to iter backwardsMaxime Coste
2017-12-01Regex: Support forward and backward matching code in the same CompiledRegexMaxime Coste
No need to have two separate regexes to handle forward and backward matching, just passing RegexCompileFlags::Backward will add support for backward matching to the regex. For backward only regex, pass RegexCompileFlags::NoForward as well to disable generation of forward matching code.
2017-11-29Regex: avoid unneeded allocations and moves by reusing MatchResults storageMaxime Coste
2017-11-12Regex: Use MemoryDomain::Regex for captures and MatchResults contentsMaxime Coste
2017-11-01Regex: Remove boost related codeMaxime Coste
2017-11-01Regex: move try/catch blocks inside boost specific codeMaxime Coste
2017-11-01Make use of custom regex backward searching support for reverse searchMaxime Coste
2017-11-01Regex: Make boost checking disableable at compile timeMaxime Coste
2017-11-01Regex: switch to custom impl, use boost for checkingMaxime Coste
2017-11-01Regex: Fix handling of match_prev_avail for boost regexMaxime Coste
We were passing around iterators that were not allowed to go before the begin iterator.
2017-11-01Regex: Introduce RegexExecFlags::PrevAvailableMaxime Coste
Rework assertion code as well.
2017-11-01Regex: Find potential start position using a map of valid start charsMaxime Coste
With this optimization we get close to performance parity with boost regex on the common use cases in Kakoune.
2017-11-01Regex: Replace boost regex_iterator impl with our ownMaxime Coste
Ensure we check the results from our own regex impl in all uses of regexs in Kakoune.
2017-11-01Regex: introduce RegexExecFlags to control various behavioursMaxime Coste
2017-11-01Regex: validate that our custom impl gets the same results as boost regexMaxime Coste
In addition to running boost regex, run our custom regex and compare the results to ensure the two regex engine agree.
2017-10-10Move all non-core string code to string_utils.{hh,cc}Maxime Coste
2017-08-14Style tweak for regex codeMaxime Coste
2016-12-14Fix regex.hh compilationMaxime Coste
Repeat after me: I will not blindly push commits that I havent compiled. Fixes #990
2016-12-14Make Regex a class rather than a struct to avoid mismatched tags warningsMaxime Coste
2016-11-28Fix matching flags not being forwarded to regex_searchMaxime Coste
Still does not fully fix #921
2016-09-06Do not let boost regex errors propagate, convert them to Kakoune errors.Maxime Coste
2016-08-18Try to fix travis ciMaxime Coste
2016-08-06Add information of types of optionsMaxime Coste
2016-05-19Go back to libc locale and use c_regex_traitsMaxime Coste
Unfortunately, cygwin does not support c++ locales.
2016-05-10Use boost::wregex implementation and manually utf8 decode into itMaxime Coste
That way we get proper unicode support in regular expressions as long as the current locale treats wchar_t as unicode codepoints. Fixes #638 Fixes #595 Fixes #162
2016-04-16Remove iterator based regex constructorMaxime Coste
2016-02-04String usage cleanupsMaxime Coste
2015-12-23Pass flags to the regex engine to correct anchorsMaxime Coste
Current behaviour was matching ^ $ for the current search start/end (and \b was always matching begin/end as well). Fixes #536
2015-09-15Fix compilation with std regexMaxime Coste
2015-07-14Transform boost/std regex_error to Kakoune::regex_error at Regex constructionMaxime Coste
Fixes #318
2015-04-29Fix formattingMaxime Coste
2015-04-08Regex comparison operator are constMaxime Coste