feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -22,6 +22,7 @@ if env["builtin_pcre2"]:
"pcre2_chartables.c",
"pcre2_chkdint.c",
"pcre2_compile.c",
"pcre2_compile_class.c",
"pcre2_config.c",
"pcre2_context.c",
"pcre2_convert.c",
@ -52,7 +53,7 @@ if env["builtin_pcre2"]:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_regex.Prepend(CPPPATH=[thirdparty_dir])
env_regex.Prepend(CPPEXTPATH=[thirdparty_dir])
env_regex.Append(CPPDEFINES=thirdparty_flags)
def pcre2_builtin(width):

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="M2 14h3v-3H2zM6.561 2.855a21 21 0 0 1 2.82 1.185A21 21 0 0 1 9.137 1h1.77a21 21 0 0 1-.28 3.027 21 21 0 0 1 2.88-1.171l.562 1.733a21 21 0 0 1-3.04.684 21 21 0 0 1 2.1 2.307l-1.465 1.037a21 21 0 0 1-1.672-2.624 21 21 0 0 1-1.587 2.624L6.965 7.58a21 21 0 0 1 2.026-2.308A21 21 0 0 1 6 4.59z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="M2 14h3v-3H2zM6.561 2.855a21 21 0 0 1 2.82 1.185A21 21 0 0 1 9.137 1h1.77a21 21 0 0 1-.28 3.027 21 21 0 0 1 2.88-1.171l.562 1.733a21 21 0 0 1-3.04.684 21 21 0 0 1 2.1 2.307l-1.465 1.037a21 21 0 0 1-1.672-2.624 21 21 0 0 1-1.587 2.624L6.965 7.58a21 21 0 0 1 2.026-2.308A21 21 0 0 1 6 4.59z"/></svg>

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 385 B

Before After
Before After

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="M5 13h2v-2H5zm2.5-8a14 14 0 0 1 1.88.79 14 14 0 0 1-.163-2.027h1.18a14 14 0 0 1-.186 2.018 14 14 0 0 1 1.92-.78l.374 1.155a14 14 0 0 1-2.026.456 14 14 0 0 1 1.4 1.538l-.977.691a14 14 0 0 1-1.115-1.75 14 14 0 0 1-1.058 1.75l-.96-.691A14 14 0 0 1 9.12 6.61a14 14 0 0 1-1.993-.454zM1.67 2C0 5 0 11 1.67 14h2C2 11 2 5 3.67 2zm10.66 0c1.67 3 1.67 9 0 12h2c1.67-3 1.67-9 0-12z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="M5 13h2v-2H5zm2.5-8a14 14 0 0 1 1.88.79 14 14 0 0 1-.163-2.027h1.18a14 14 0 0 1-.186 2.018 14 14 0 0 1 1.92-.78l.374 1.155a14 14 0 0 1-2.026.456 14 14 0 0 1 1.4 1.538l-.977.691a14 14 0 0 1-1.115-1.75 14 14 0 0 1-1.058 1.75l-.96-.691A14 14 0 0 1 9.12 6.61a14 14 0 0 1-1.993-.454zM1.67 2C0 5 0 11 1.67 14h2C2 11 2 5 3.67 2zm10.66 0c1.67 3 1.67 9 0 12h2c1.67-3 1.67-9 0-12z"/></svg>

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 467 B

Before After
Before After

View file

@ -69,7 +69,7 @@ String RegExMatch::get_subject() const {
}
int RegExMatch::get_group_count() const {
if (data.size() == 0) {
if (data.is_empty()) {
return 0;
}
return data.size() - 1;
@ -197,7 +197,7 @@ Error RegEx::compile(const String &p_pattern, bool p_show_error) {
PCRE2_UCHAR32 buf[256];
pcre2_get_error_message_32(err, buf, 256);
String message = String::num_int64(offset) + ": " + String((const char32_t *)buf);
ERR_PRINT(message.utf8());
ERR_PRINT(message);
}
return FAILED;
}
@ -326,7 +326,7 @@ int RegEx::_sub(const String &p_subject, const String &p_replacement, int p_offs
pcre2_match_context_free_32(mctx);
if (res >= 0) {
r_output = String(output.ptr(), olength) + p_subject.substr(length);
r_output = String::utf32(Span(output.ptr(), olength)) + p_subject.substr(length);
}
return res;
@ -348,7 +348,7 @@ String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_a
PCRE2_UCHAR32 buf[256];
pcre2_get_error_message_32(res, buf, 256);
String message = "PCRE2 Error: " + String((const char32_t *)buf);
ERR_PRINT(message.utf8());
ERR_PRINT(message);
if (res == PCRE2_ERROR_NOSUBSTRING) {
flags |= PCRE2_SUBSTITUTE_UNKNOWN_UNSET;

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef REGEX_H
#define REGEX_H
#pragma once
#include "core/object/ref_counted.h"
#include "core/string/ustring.h"
@ -108,5 +107,3 @@ public:
RegEx(const String &p_pattern);
~RegEx();
};
#endif // REGEX_H

View file

@ -28,12 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef REGEX_REGISTER_TYPES_H
#define REGEX_REGISTER_TYPES_H
#pragma once
#include "modules/register_module_types.h"
void initialize_regex_module(ModuleInitializationLevel p_level);
void uninitialize_regex_module(ModuleInitializationLevel p_level);
#endif // REGEX_REGISTER_TYPES_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef TEST_REGEX_H
#define TEST_REGEX_H
#pragma once
#include "../regex.h"
@ -423,5 +422,3 @@ TEST_CASE("[RegEx] Lookbehind groups empty matches") {
}
} // namespace TestRegEx
#endif // TEST_REGEX_H