[colorer/Colorer-library] cregexp_refactoring: Fix CRegExp docs and drop leftover includes and comments. (63dfaf4)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Aug 16, 2026, 1:46:23 PM (14 hours ago) Aug 16
to farco...@googlegroups.com
Repository : https://github.com/colorer/Colorer-library
On branch : cregexp_refactoring
Link : https://github.com/colorer/Colorer-library/commit/63dfaf499176aea746a69e328eb7534b2f387801

>---------------------------------------------------------------

commit 63dfaf499176aea746a69e328eb7534b2f387801
Author: Aleksey Dobrunov <cta...@ctapmex.com>
Date: Sun Aug 16 22:42:46 2026 +0500

Fix CRegExp docs and drop leftover includes and comments.


>---------------------------------------------------------------

63dfaf499176aea746a69e328eb7534b2f387801
src/colorer/cregexp/cregexp.cpp | 7 -------
src/colorer/cregexp/cregexp.h | 4 ++--
2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/colorer/cregexp/cregexp.cpp b/src/colorer/cregexp/cregexp.cpp
index d63a2db..3405b6c 100644
--- a/src/colorer/cregexp/cregexp.cpp
+++ b/src/colorer/cregexp/cregexp.cpp
@@ -1,7 +1,4 @@
#include "colorer/cregexp/cregexp.h"
-#include <array>
-#include <cstdio>
-#include <cstdlib>
#include <cstring>

StackElem* CRegExp::RegExpStack {nullptr};
@@ -610,18 +607,15 @@ EError CRegExp::setStructs(SRegInfo*& re, const UnicodeString& expr, int& retPos
}
// ( ... )
if (expr[i] == '(') {
- // bool namedBracket = false;
// perl-like "uncaptured" brackets
if (expr.length() >= i + 2 && expr[i + 1] == '?' && expr[i + 2] == ':') {
next->op = EOps::ReNamedBrackets;
next->param0 = -1;
- // namedBracket = true;
i += 3;
}
else if (expr.length() > i + 2 && expr[i + 1] == '?' && expr[i + 2] == '{') {
// named bracket
next->op = EOps::ReNamedBrackets;
- // namedBracket = true;
auto s_curly = UnicodeTools::getCurlyContent(expr, i + 2);
if (s_curly == nullptr)
return EError::EBRACKETS;
@@ -1484,7 +1478,6 @@ inline bool CRegExp::parseRE(int pos)
matches->cMatch = cMatch;
matches->cnMatch = cnMatch;
do {
- // stack=null;
if (lowParse(tree_root, nullptr, toParse)) {
matches->topseSanitize(cMatch - 1);
matches->topnseSanitize(cnMatch - 1);
diff --git a/src/colorer/cregexp/cregexp.h b/src/colorer/cregexp/cregexp.h
index 33dc5b5..1380ed8 100644
--- a/src/colorer/cregexp/cregexp.h
+++ b/src/colorer/cregexp/cregexp.h
@@ -204,7 +204,7 @@ enum ReAction {
- \\yN \\YN \\y{name} \\Y{name} - back reference into another RE's bracket.

\par 1.3. Perl compatibility.
- - Modifiers //ismx
+ - Modifiers //isx
- \\ p{name} - back reference to named bracket (but not named property as in Perl!)
- No POSIX character classes support.

@@ -216,7 +216,7 @@ enum ReAction {
- No surrogate symbols support,
- No string length changes on case mappings (only 1 <-> 1 mappings),
\par 2.2. Algorithmic problems:
- - Stack recursion implementation.
+ - Explicit parse stack (unbounded growth, shared between CRegExp instances).

@ingroup cregexp
*/


Reply all
Reply to author
Forward
0 new messages