aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexPerl.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-12-19 01:21:19 +0000
committernyamatongwe <unknown>2000-12-19 01:21:19 +0000
commit9e91e969b5b32bbc4bfbb4b72b33514670b6439d (patch)
treeb913606f6813a28728a52dd0d156baa787355ed3 /src/LexPerl.cxx
parent9f18dafb246a9f85ebbc34df95a1554286c3adaf (diff)
downloadscintilla-mirror-9e91e969b5b32bbc4bfbb4b72b33514670b6439d.tar.gz
Perl updated.
If property line has no '=' it is treated as '=1'.
Diffstat (limited to 'src/LexPerl.cxx')
-rw-r--r--src/LexPerl.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index 9956c8fb2..f63816d8b 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -128,8 +128,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
startPos = styler.LineStart(styler.GetLine(startPos));
state = styler.StyleAt(startPos - 1);
}
- if (state == SCE_PL_REGEX ||
- state == SCE_PL_REGSUBST || state == SCE_PL_LONGQUOTE) {
+ if (state == SCE_PL_REGEX || state == SCE_PL_REGSUBST
+ || state == SCE_PL_LONGQUOTE || state == SCE_PL_STRING_Q) {
while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) {
startPos--;
}
@@ -138,6 +138,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.StartAt(startPos);
char chPrev = styler.SafeGetCharAt(startPos - 1);
+ if (startPos == 0)
+ chPrev = '\n';
char chNext = styler[startPos];
styler.StartSegment(startPos);
@@ -195,6 +197,12 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
quoteUp = '\0';
quoteDown = '\0';
quoteRep = 1;
+ } else if (ch == 'q' && !isalnum(chNext)) {
+ state = SCE_PL_STRING_Q;
+ quotes = 0;
+ quoteUp = '\0';
+ quoteDown = '\0';
+ quoteRep = 1;
} else if (ch == 't' && chNext == 'r' && !isalnum(chNext2)) {
state = SCE_PL_REGSUBST;
quotes = 0;
@@ -262,13 +270,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i - 1, state);
if (isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_') {
state = SCE_PL_HASH;
- // } else if (chNext != '{' && chNext != '[') {
} else if (chNext == '{') {
styler.ColourTo(i, SCE_PL_HASH);
- // i++;
- // ch = ' ';
} else {
- // styler.ColourTo(i, SCE_PL_HASH);
styler.ColourTo(i, SCE_PL_OPERATOR);
}
} else if (ch == '*') {
@@ -287,7 +291,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
HereDoc.State = 0;
} else if (ch == '='
&& isalpha(chNext)
- && ((startPos == 0) || isEOLChar(chPrev))) {
+ && (isEOLChar(chPrev))) {
styler.ColourTo(i - 1, state);
state = SCE_PL_POD;
quotes = 0;
@@ -302,7 +306,10 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i, SCE_PL_OPERATOR);
}
} else if (state == SCE_PL_WORD) {
- if (!iswordchar(ch) && ch != '\'') { // Archaic Perl has quotes inside names
+ if ((!iswordchar(ch) && ch != '\'')
+ || (ch == '.' && chNext == '.')) {
+ // ".." is always an operator if preceded by a SCE_PL_WORD.
+ // Archaic Perl has quotes inside names
if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__DATA__")) {
styler.ColourTo(i, SCE_PL_DATASECTION);
state = SCE_PL_DATASECTION;
@@ -595,7 +602,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
}
}
}
- } else if (state == SCE_PL_LONGQUOTE) {
+ } else if (state == SCE_PL_LONGQUOTE || state == SCE_PL_STRING_Q) {
if (!quoteDown && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(quoteUp);