Commit graph

76 commits

Author SHA1 Message Date
Nick Treleaven
ccd3115b8b [std.regex] Fix unsafe casts to bool
These are disallowed in `@safe` code with
https://github.com/dlang/dmd/pull/16558.
2024-06-03 16:27:09 +02:00
Dennis Korpel
af132bedb1 std.regex: put disassemble function in debug version 2024-01-10 00:32:27 +01:00
Dennis
569bc57098
Mark unsafe union access @trusted (#8787) 2023-07-31 13:58:35 +03:00
Richard (Rikki) Andrew Cattermole
f22cc260f8
Improve std.regex wordMatcher build times by delaying its work from CT to RT if possible (#8699) 2023-06-15 09:44:40 +03:00
Max Haughton
e0ce464118 Fix Issue 21600 - (Try to) Document named captures 2021-07-20 01:55:01 +01:00
MoonlightSentinel
ff934f9332 Remove duplicate assumePureFunction from std.regex
It's redundant and has the same invalid constraint that was
fixed for the other implementation
2021-05-10 13:17:42 +02:00
MoonlightSentinel
5b6507df1f Fix template constraint of assumePureFunction
The constraint was actually a runtime `if`, leaving `assumePureFunction`
without a `return` at the end of the function.
2021-04-26 14:55:11 +02:00
Jon Degenhardt
34e58ec857 Fix issue 21716: std.regex performance regression. 2021-04-25 20:43:24 +08:00
berni44
6f2a0934a7 Adapt imports of std.format to new structure of std.format. 2021-03-19 13:22:00 +01:00
Martin Kinkelin
1a459c5996 Get rid of std.conv.emplace[Ref](), use core[.internal].lifetime
The emplace() stuff was moved to druntime; for some reason, it's still
in Phobos.

I've diffed the two versions, and they are still almost identical (incl.
unittests); the druntime version appears to have seen some improvements
(e.g., forwarding r/lvalueness of the arguments) in the meantime.
2021-01-17 16:02:25 +01:00
Luís Ferreira
d97b65a697
regex: partially make regex pure
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2020-10-26 18:05:46 +00:00
Luís Ferreira
35e2ac7a60
regex: use pure/enforce version of malloc/free functions
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2020-10-26 17:17:39 +00:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Nathan Sashihara
e226022680 Fix Issue 20098 - Improve result of printing std.regex compiled pattern 2019-08-02 15:53:21 -07:00
Vladimir Panteleev
6c5d7230bc
Fix Issue 19979 - std.regex should return null for non-matched captures 2019-06-17 21:11:06 +00:00
Nathan Sashihara
725278b2ce Fix Issue 19331 - std.regex.internal.ir.SmallFixedArray.toHash is ignored because it's non-const 2018-10-25 03:22:04 -04:00
Martin Nowak
9fdcf660dd Merge remote-tracking branch 'upstream/stable' into merge_stable
# Conflicts:
#	std/bitmanip.d
2018-04-06 19:39:58 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Dmitry Olshansky
b602b5a3f4 Fix issue 18691 - memory errors in std.regex.Captures
Instead of a messy code that ended up with refcount at the wrong place
provide a clean fixed-size array with required semantics and
build on top of that.
2018-03-29 19:49:51 +03:00
Dmitry Olshansky
4318073f40 Fix issue 18600 Revamp std.regex caching for matchFirst case 2018-03-21 14:53:34 +03:00
Martin Nowak
59520969ef fix Issue 18114 - regex performance regression
- reduce copying of fat structs
- optimize layouts and opAssign of Captures
2018-02-22 16:59:09 +01:00
Martin
3db3dd8899 std.regex: Alignment hotfix
This fixes the unittests for LDC on ARM (with enabled optimizations).

The code used to store a class instance (whose size isn't padded) right
before some buffer, without any padding inbetween. The buffer is thus
susceptible to misalignment; e.g., `BacktrackingMatcher.dupTo()` casts
the buffer from `void[]` to `size_t[]` (in `initExternalMemory()`),
simply assuming an alignment >= `size_t.alignof`, which only holds if
the prepended class instance size is a multiple of that (as `malloc()`
returns a sufficiently aligned block already in this case).
2018-02-15 20:41:59 +01:00
Dmitry Olshansky
881658eabc Faster to import std.regex, by lazy eval of wordMatcher 2017-12-18 17:50:53 +03:00
Dmitry Olshansky
13ea5f9aea Drop another level of templatizations in backtracking 2017-10-11 18:18:12 +03:00
Dmitry Olshansky
41c229647d Need to propagate subCounters
Disable "benchmark" in unittest, it's too volatile
with different compiler flags
Also use GC.addRange/GC.removeRange
2017-10-06 11:20:55 +03:00
Dmitry Olshansky
8bfa66c50a Fix CI complaints 2017-09-28 11:55:43 +03:00
Dmitry Olshansky
c7bdfbe51b std.regex finish the loose ends in the great refactoring 2017-09-28 11:55:43 +03:00
Dmitry Olshansky
639dd3dd6f The new std.regex design is concluded, going through the unitests 2017-09-28 11:55:43 +03:00
Dmitry Olshansky
33d7ecc84c Finalized matcher factory abstraction, with compile-time regex support 2017-09-28 11:55:43 +03:00
Dmitry Olshansky
6e684343d7 WIP - refactoring towards sane std.regex code 2017-09-28 11:55:43 +03:00
Dmitry Olshansky
905788a65a Move unicode set parser out of std.regex
This only does the move without adapting
the interface to the commonly accepted ranges.
2017-08-23 19:17:55 +03:00
Sebastian Wilzbach
2070d867dd Sort multiple packages within one line 2017-06-12 08:18:25 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
Sebastian Wilzbach
203755d296 Automatically add spaces to binary operators (>>)
command:

sed -E "s/([[:alnum:]]) >> ([[:alnum:]])/\1 >> \2/g" -i **/*.d
sed -E "s/([[:alnum:]])>> ([[:alnum:]])/\1 >> \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) >>([[:alnum:]])/\1 >> \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Sebastian Wilzbach
ef7be4b60d Automatically add spaces to binary operators (<<)
command:

sed -E "s/([[:alnum:]]) << ([[:alnum:]])/\1 << \2/g" -i **/*.d
sed -E "s/([[:alnum:]])<< ([[:alnum:]])/\1 << \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) <<([[:alnum:]])/\1 << \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Sebastian Wilzbach
425ab667a3 Automatically set the range style from a..b -> a .. b
Commands:

sed -E "s/([[:alnum:]])[.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]])[.][.] ([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) [.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
2017-02-22 05:37:31 +01:00
Sebastian Wilzbach
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +01:00
Sebastian Wilzbach
5521541032 Unify assert style to have no spaces between the first brace
Application of:

sed -E "s/assert +\(/assert(/" -i **/*.d
2017-02-21 15:27:15 +01:00
Sebastian Wilzbach
87dec58a41 DStyle: Constraints on declarations should have the same indentation level 2017-02-17 07:36:23 +01:00
Jack Stouffer
5a2491a847 Fix Issue 17161 - Revert all changes to std.regex from 2.072.2 onwards 2017-02-12 12:30:40 -05:00
Sebastian Wilzbach
64217c8965 Style fix: specify/remove local imports 2016-12-08 01:46:47 +01:00
Dmitry Olshansky
f8b3eea065 [std.regex] Addressing review comments 2016-10-09 15:35:32 +03:00
Dmitry Olshansky
e98fa4ad5a [std.regex] Fix issue 9391 - const regex, ctRegex is immutable 2016-10-07 01:40:41 +03:00
Dmitry Olshansky
b94a203b0b [std.regex] Re-style pass 2016-10-01 20:59:12 +03:00
Dmitry Olshansky
ecd33f148c [std.regex] Get Bit-NFA working on the testsuite 2016-10-01 20:59:12 +03:00
Dmitry Olshansky
99095eebfc ASCII-only version of Bit-NFA 2016-10-01 20:59:12 +03:00
Dmitry Olshansky
66048ae334 [Refactor] Generalize kickstart engines, in preparation for more to come 2016-10-01 20:59:12 +03:00
Jack Stouffer
399b4fa842 Fixed package wide std.algorithm imports in std.regex.internal.ir 2016-07-05 00:13:24 -04:00
Jack Stouffer
f9001ae545 Removed package wide std.range import from std.regex.internal.ir 2016-07-04 15:37:30 -04:00
Jack Stouffer
5698ca33cf Fixed local imports in std.regex.internal.ir 2016-07-01 12:27:33 -04:00