diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/SCsub | 2 | ||||
| -rw-r--r-- | modules/freetype/SCsub | 6 | ||||
| -rw-r--r-- | modules/regex/regex.cpp | 28 |
3 files changed, 25 insertions, 11 deletions
diff --git a/modules/SCsub b/modules/SCsub index 4b9c08cf7..d1c0cdc05 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -7,7 +7,7 @@ env_modules = env.Clone() Export('env_modules') env.modules_sources = [ - "register_module_types.cpp", + "register_module_types.gen.cpp", ] # env.add_source_files(env.modules_sources,"*.cpp") Export('env') diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index 8401c36b5..6a89e8e08 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -34,10 +34,13 @@ if (env['builtin_freetype'] != 'no'): "src/base/fttype1.c", "src/base/ftwinfnt.c", "src/bdf/bdf.c", + "src/bzip2/ftbzip2.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/type1cid.c", "src/gxvalid/gxvalid.c", + "src/gzip/ftgzip.c", + "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", @@ -77,6 +80,9 @@ if (env['builtin_freetype'] != 'no'): break if not inserted: env.Append(LIBS=[lib]) + env.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY']) + if (env['target'] != 'release'): + env.Append(CCFLAGS=['-DZLIB_DEBUG']) # Godot source files env.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index eb9f1d2ab..c3e97e357 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -590,6 +590,11 @@ struct RegExNodeGroup : public RegExNode { memdelete(childset[i]); } + virtual void test_success(RegExSearch &s, int pos) const { + + return; + } + virtual int test(RegExSearch &s, int pos) const { for (int i = 0; i < childset.size(); ++i) { @@ -598,10 +603,8 @@ struct RegExNodeGroup : public RegExNode { int res = childset[i]->test(s, pos); - if (s.complete) - return res; - if (inverse) { + s.complete = false; if (res < 0) res = pos + 1; else @@ -611,9 +614,13 @@ struct RegExNodeGroup : public RegExNode { continue; } + if (s.complete) + return res; + if (res >= 0) { if (reset_pos) res = pos; + this->test_success(s, res); return next ? next->test(s, res) : res; } } @@ -668,6 +675,12 @@ struct RegExNodeCapturing : public RegExNodeGroup { id = p_id; } + virtual void test_success(RegExSearch &s, int pos) const { + + RegExMatch::Group &ref = s.match->captures[id]; + ref.length = pos - ref.start; + } + virtual int test(RegExSearch &s, int pos) const { RegExMatch::Group &ref = s.match->captures[id]; @@ -676,13 +689,8 @@ struct RegExNodeCapturing : public RegExNodeGroup { int res = RegExNodeGroup::test(s, pos); - if (res >= 0) { - if (!s.complete) - ref.length = res - pos; - } else { + if (res < 0) ref.start = old_start; - } - return res; } @@ -1488,7 +1496,7 @@ void RegEx::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &RegEx::clear); ClassDB::bind_method(D_METHOD("compile", "pattern"), &RegEx::compile); - ClassDB::bind_method(D_METHOD("search", "text", "start", "end"), &RegEx::search, DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("search:RegExMatch", "text", "start", "end"), &RegEx::search, DEFVAL(0), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("sub", "text", "replacement", "all", "start", "end"), &RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("is_valid"), &RegEx::is_valid); ClassDB::bind_method(D_METHOD("get_pattern"), &RegEx::get_pattern); |
