aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RESearch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/RESearch.cxx')
-rw-r--r--src/RESearch.cxx22
1 files changed, 11 insertions, 11 deletions
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... */