summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-23 23:59:27 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-25 09:47:36 +0100
commit8465683dcf1ede4dbab46915113dd2ce4e4b7dfb (patch)
tree392cdf423fabec6af5550d831e07217fd0e3287b /Userland/Libraries/LibRegex
parentbb483f7ef4693582d34aa7a30fa2916fdcc8b6f4 (diff)
downloadserenity-8465683dcf1ede4dbab46915113dd2ce4e4b7dfb.zip
Everywhere: Debug macros instead of constexpr.
This was done with the following script: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
Diffstat (limited to 'Userland/Libraries/LibRegex')
-rw-r--r--Userland/Libraries/LibRegex/RegexByteCode.cpp2
-rw-r--r--Userland/Libraries/LibRegex/RegexMatcher.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibRegex/RegexByteCode.cpp b/Userland/Libraries/LibRegex/RegexByteCode.cpp
index 5f124b3468..b996c4b7ca 100644
--- a/Userland/Libraries/LibRegex/RegexByteCode.cpp
+++ b/Userland/Libraries/LibRegex/RegexByteCode.cpp
@@ -370,7 +370,7 @@ ALWAYS_INLINE ExecutionResult OpCode_SaveRightNamedCaptureGroup::execute(const M
auto& map = output.named_capture_group_matches.at(input.match_index);
- if constexpr (debug_regex) {
+ if constexpr (REGEX_DEBUG) {
ASSERT(start_position + length <= input.view.length());
dbgln("Save named capture group with name={} and content='{}'", capture_group_name, input.view.substring_view(start_position, length));
}
diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp
index cadc74fece..16a6662351 100644
--- a/Userland/Libraries/LibRegex/RegexMatcher.cpp
+++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp
@@ -148,7 +148,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional
for (auto& view : views) {
input.view = view;
- dbgln<debug_regex>("[match] Starting match with view ({}): _{}_", view.length(), view);
+ dbgln<REGEX_DEBUG>("[match] Starting match with view ({}): _{}_", view.length(), view);
auto view_length = view.length();
size_t view_index = m_pattern.start_offset;
@@ -214,7 +214,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional
continue;
}
- if constexpr (debug_regex) {
+ if constexpr (REGEX_DEBUG) {
dbgln("state.string_position={}, view_index={}", state.string_position, view_index);
dbgln("[match] Found a match (length={}): '{}'", state.string_position - view_index, input.view.substring_view(view_index, state.string_position - view_index));
}