aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2004-05-17 12:52:17 +0000
committernyamatongwe <devnull@localhost>2004-05-17 12:52:17 +0000
commit88ac13a64c7bf7be2d03b32c376d79242fcb1f71 (patch)
treed2704302773b87bf4b1773dbc5f485d1b8541400 /src
parent73979cb16e00d555c9a8f243c4d3c1001cbc2823 (diff)
downloadscintilla-mirror-88ac13a64c7bf7be2d03b32c376d79242fcb1f71.tar.gz
Patch from Kein-Hong Man to improve handling of '/'.
Diffstat (limited to 'src')
-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);
+