From f4f4b15bfc7fd7c43c5a2f0bea832b4a2d40e1f9 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 17 May 2004 12:52:17 +0000 Subject: Patch from Kein-Hong Man to improve handling of '/'. --- src/LexPerl.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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); + -- cgit v1.2.3