diff options
author | nyamatongwe <unknown> | 2004-05-17 12:52:17 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-05-17 12:52:17 +0000 |
commit | f4f4b15bfc7fd7c43c5a2f0bea832b4a2d40e1f9 (patch) | |
tree | d2704302773b87bf4b1773dbc5f485d1b8541400 /src/LexPerl.cxx | |
parent | 57674c45b77b0994feeb85f6efd7ff2ed06439f2 (diff) | |
download | scintilla-mirror-f4f4b15bfc7fd7c43c5a2f0bea832b4a2d40e1f9.tar.gz |
Patch from Kein-Hong Man to improve handling of '/'.
Diffstat (limited to 'src/LexPerl.cxx')
-rw-r--r-- | src/LexPerl.cxx | 11 |
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); + |