Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gitgalaxy/standards/language_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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% |
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions tests/extraction/languages/test_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/extraction/languages/test_cpp_strict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down