aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-06-04 02:30:25 +0000
committernyamatongwe <unknown>2005-06-04 02:30:25 +0000
commite2191ba52a0b0ce46bbc93c3714b0b91c662a016 (patch)
tree98fd425180bceb3df0e0c46db9f6abc47a99dafa /src
parent9dc1b220fbf1c5b344a9c7d36a07b3a818306f54 (diff)
downloadscintilla-mirror-e2191ba52a0b0ce46bbc93c3714b0b91c662a016.tar.gz
Addition of SCE_PL_POD_VERB by Kein-Hong Man.
Diffstat (limited to 'src')
-rw-r--r--src/LexPerl.cxx35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index ed680e0ce..d6a34b910 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -2,8 +2,8 @@
/** @file LexPerl.cxx
** Lexer for subset of Perl.
**/
-// Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my> 2003-2004
-// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
@@ -497,6 +497,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
// other styles uses the default, preferRE=false
case SCE_PL_WORD:
case SCE_PL_POD:
+ case SCE_PL_POD_VERB:
case SCE_PL_HERE_Q:
case SCE_PL_HERE_QQ:
case SCE_PL_HERE_QX:
@@ -755,15 +756,25 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
}
chNext = styler.SafeGetCharAt(i + 1);
}
- } else if (state == SCE_PL_POD) {
- if (ch == '=' && isEOLChar(chPrev)) {
- if (isMatch(styler, lengthDoc, i, "=cut")) {
- styler.ColourTo(i - 1 + 4, state);
- i += 4;
- state = SCE_PL_DEFAULT;
- ch = styler.SafeGetCharAt(i);
- //chNext = styler.SafeGetCharAt(i + 1);
- goto restartLexer;
+ } else if (state == SCE_PL_POD
+ || state == SCE_PL_POD_VERB) {
+ if (isEOLChar(chPrev)) {
+ if (ch ==' ' || ch == '\t') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PL_POD_VERB;
+ } else {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PL_POD;
+ if (ch == '=') {
+ if (isMatch(styler, lengthDoc, i, "=cut")) {
+ styler.ColourTo(i - 1 + 4, state);
+ i += 4;
+ state = SCE_PL_DEFAULT;
+ ch = styler.SafeGetCharAt(i);
+ //chNext = styler.SafeGetCharAt(i + 1);
+ goto restartLexer;
+ }
+ }
}
}
} else if (state == SCE_PL_SCALAR // variable names
@@ -967,7 +978,7 @@ static void FoldPerlDoc(unsigned int startPos, int length, int, WordList *[],
if (foldPOD && atLineStart) {
int stylePrevCh = (i) ? styler.StyleAt(i - 1):SCE_PL_DEFAULT;
if (style == SCE_PL_POD) {
- if (stylePrevCh != SCE_PL_POD)
+ if (stylePrevCh != SCE_PL_POD && stylePrevCh != SCE_PL_POD_VERB)
levelCurrent++;
else if (styler.Match(i, "=cut"))
levelCurrent--;