diff --git a/gitgalaxy/standards/language_standards.py b/gitgalaxy/standards/language_standards.py index aae468442..a0cdc7f76 100644 --- a/gitgalaxy/standards/language_standards.py +++ b/gitgalaxy/standards/language_standards.py @@ -36,7 +36,7 @@ | -------- | ----------- | -------------- | ------------ | --------------- | | Apex | 100.0% | 100.0% | 100.0% | 100.0% | | C | 99.0% | 99.5% | 100.0% | 100.0% | -| Cpp | 86.9% | 94.9% | 100.0% | 100.0% | +| Cpp | 87.0% | 95.6% | 100.0% | 100.0% | | Csharp | 100.0% | 100.0% | 100.0% | 100.0% | | Css | 100.0% | 100.0% | N/A | N/A | | Dart | 99.4% | 99.3% | 100.0% | 100.0% | @@ -3273,7 +3273,7 @@ class PrismConfigSchema(TypedDict): # [IRON WALL - CATASTROPHIC BACKTRACKING FIX]: # We enforce strict numeric bounds (`{0,500}` and `{0,100}`) instead of `+` or `*`. # This caps the permutation tree instantly. - r"(?:[ \t\n]*(?![ \t]*#):[^{;]{0,500}|(?:[ \t\n]+(?![ \t]*#)[a-zA-Z_][^(){};]{0,100};){1,20})?" + r"(?:[ \t\n]*(?![ \t]*#):[^{;]{0,2000}|(?:[ \t\n]+(?![ \t]*#)[a-zA-Z_][^(){};]{0,100};){1,20})?" # 10. THE IGNITION (The opening brace confirming it is a definition, not a declaration) r"[ \t\n]*\{", re.M, diff --git a/tests/extraction/languages/test_cpp.py b/tests/extraction/languages/test_cpp.py index 9ca121a60..5b0981227 100644 --- a/tests/extraction/languages/test_cpp.py +++ b/tests/extraction/languages/test_cpp.py @@ -80,6 +80,10 @@ "MyClass::MyClass(int x) : field_(x), other_(0) {", "MyClass::MyClass", ), # out-of-line constructor, multi-field member-init list + ( + "MyClass::MyClass(int x) : " + "field_a(1), " * 60 + "field_z(2) {", + "MyClass::MyClass", + ), # synthetic long initializer-list (over 500 chars, under 2000) ], "invalid": [ "class TargetFunc {", # class decl lookalike diff --git a/tests/extraction/languages/test_cpp_strict.py b/tests/extraction/languages/test_cpp_strict.py index 7dcdcdfd5..198f12303 100644 --- a/tests/extraction/languages/test_cpp_strict.py +++ b/tests/extraction/languages/test_cpp_strict.py @@ -560,6 +560,7 @@ def test_cpp_redos_immunity_sweep(): assert_redos_immune(CPP_RULES["args"], "std::vector<" + "a" * 100000, timeout_sec=3.0) assert_redos_immune(CPP_RULES["func_start"], "std::vector<" + "a," * 16000, timeout_sec=3.0) assert_redos_immune(CPP_RULES["func_start"], "__attribute__((" + "a" * 100000, timeout_sec=3.0) + assert_redos_immune(CPP_RULES["func_start"], "MyClass() :" + "a" * 100000, timeout_sec=3.0) assert_redos_immune(CPP_RULES["class_start"], "struct " + "a" * 100000, timeout_sec=3.0) assert_redos_immune(CPP_RULES["class_start"], "template<" + "a," * 16000, timeout_sec=3.0) assert_redos_immune(CPP_RULES["closures"], "[" + "a" * 100000, timeout_sec=3.0)