diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ExternalLexer.cxx | 6 | ||||
-rw-r--r-- | src/RESearch.cxx | 22 | ||||
-rw-r--r-- | src/RESearch.h | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/ExternalLexer.cxx b/src/ExternalLexer.cxx index 0344debd7..a4e29e314 100644 --- a/src/ExternalLexer.cxx +++ b/src/ExternalLexer.cxx @@ -172,13 +172,13 @@ LexerLibrary::~LexerLibrary() { void LexerLibrary::Release() { //TODO maintain a list of lexers created, and delete them! LexerMinder *lm; - LexerMinder *next; + LexerMinder *lmNext; lm = first; while (NULL != lm) { - next = lm->next; + lmNext = lm->next; delete lm->self; delete lm; - lm = next; + lm = lmNext; } first = NULL; diff --git a/src/RESearch.cxx b/src/RESearch.cxx index be1d235de..57c745e2d 100644 --- a/src/RESearch.cxx +++ b/src/RESearch.cxx @@ -33,7 +33,7 @@ * Interfaces: * RESearch::Compile: compile a regular expression into a NFA. * - * const char *RESearch::Compile(const char *pat, int length, + * const char *RESearch::Compile(const char *pattern, int length, * bool caseSensitive, bool posix) * * Returns a short error string if they fail. @@ -347,13 +347,13 @@ static int GetHexaChar(unsigned char hd1, unsigned char hd2) { /** * Called when the parser finds a backslash not followed * by a valid expression (like \( in non-Posix mode). - * @param pat: pointer on the char after the backslash. + * @param pattern: pointer on the char after the backslash. * @param incr: (out) number of chars to skip after expression evaluation. * @return the char if it resolves to a simple char, * or -1 for a char class. In this case, bittab is changed. */ int RESearch::GetBackslashExpression( - const char *pat, + const char *pattern, int &incr) { // Since error reporting is primitive and messages are not used anyway, // I choose to interpret unexpected syntax in a logical way instead @@ -361,7 +361,7 @@ int RESearch::GetBackslashExpression( incr = 0; // Most of the time, will skip the char "naturally". int c; int result = -1; - unsigned char bsc = *pat; + unsigned char bsc = *pattern; if (!bsc) { // Avoid overrun result = '\\'; // \ at end of pattern, take it literally @@ -379,8 +379,8 @@ int RESearch::GetBackslashExpression( result = escapeValue(bsc); break; case 'x': { - unsigned char hd1 = *(pat + 1); - unsigned char hd2 = *(pat + 2); + unsigned char hd1 = *(pattern + 1); + unsigned char hd2 = *(pattern + 2); int hexValue = GetHexaChar(hd1, hd2); if (hexValue >= 0) { result = hexValue; @@ -436,7 +436,7 @@ int RESearch::GetBackslashExpression( return result; } -const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) { +const char *RESearch::Compile(const char *pattern, int length, bool caseSensitive, bool posix) { char *mp=nfa; /* nfa pointer */ char *lp; /* saved pointer */ char *sp=nfa; /* another one */ @@ -449,14 +449,14 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b char mask; /* xor mask -CCL/NCL */ int c1, c2, prevChar; - if (!pat || !length) + if (!pattern || !length) if (sta) return 0; else return badpat("No previous regular expression"); sta = NOP; - const char *p=pat; /* pattern pointer */ + const char *p=pattern; /* pattern pointer */ for (int i=0; i<length; i++, p++) { if (mp > mpMax) return badpat("Pattern too long"); @@ -468,7 +468,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b break; case '^': /* match beginning */ - if (p == pat) + if (p == pattern) *mp++ = BOL; else { *mp++ = CHR; @@ -588,7 +588,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b case '*': /* match 0 or more... */ case '+': /* match 1 or more... */ - if (p == pat) + if (p == pattern) return badpat("Empty closure"); lp = sp; /* previous opcode */ if (*lp == CLO) /* equivalence... */ diff --git a/src/RESearch.h b/src/RESearch.h index 0944fc398..ef8c3e11b 100644 --- a/src/RESearch.h +++ b/src/RESearch.h @@ -34,7 +34,7 @@ public: RESearch(CharClassify *charClassTable); ~RESearch(); bool GrabMatches(CharacterIndexer &ci); - const char *Compile(const char *pat, int length, bool caseSensitive, bool posix); + const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix); int Execute(CharacterIndexer &ci, int lp, int endp); int Substitute(CharacterIndexer &ci, char *src, char *dst); @@ -51,7 +51,7 @@ private: void Clear(); void ChSet(unsigned char c); void ChSetWithCase(unsigned char c, bool caseSensitive); - int GetBackslashExpression(const char *pat, int &incr); + int GetBackslashExpression(const char *pattern, int &incr); int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); |