aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexPerl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/LexPerl.cxx')
-rw-r--r--src/LexPerl.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index acc8aba13..67d60fc1a 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -482,9 +482,13 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
break;
}
}
- } else {// bare identifier, usually a function
- // call but perl also uses this for
- // pseudo-constants (really ambiguous...)
+ } else {// bare identifier, usually a function call but Perl
+ // optimizes them as pseudo-constants, then the next
+ // '/' will be a divide; favour divide over regex
+ // if there is a whitespace after the '/'
+ if (isspacechar(chNext)) {
+ preferRE = false;
+ }
break;
}
bk--;
@@ -974,3 +978,4 @@ static const char * const perlWordListDesc[] = {
};
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", FoldPerlDoc, perlWordListDesc);
+