aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-01-06 00:10:06 +0000
committernyamatongwe <unknown>2001-01-06 00:10:06 +0000
commit8ad80b36b828e8e458a98a992b50efcdb261fdba (patch)
treea38fddb0453a24a4f6b5ed958b41738254ff2743
parent3995a7a46d6cef2b9673bf83a85904a995f37064 (diff)
downloadscintilla-mirror-8ad80b36b828e8e458a98a992b50efcdb261fdba.tar.gz
Patch from Steffen to separate long quote into qq, qz, qr, and qw states.
-rw-r--r--include/SciLexer.h4
-rw-r--r--include/Scintilla.iface4
-rw-r--r--src/LexPerl.cxx25
3 files changed, 28 insertions, 5 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h
index 16144558c..b7151494f 100644
--- a/include/SciLexer.h
+++ b/include/SciLexer.h
@@ -184,6 +184,10 @@
#define SCE_PL_HERE_QQ 24
#define SCE_PL_HERE_QX 25
#define SCE_PL_STRING_Q 26
+#define SCE_PL_STRING_QQ 27
+#define SCE_PL_STRING_QX 28
+#define SCE_PL_STRING_QR 29
+#define SCE_PL_STRING_QW 30
#define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1
#define SCE_L_TAG 2
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 9df285aa8..e72c83ba3 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1298,6 +1298,10 @@ val SCE_PL_HERE_Q=23
val SCE_PL_HERE_QQ=24
val SCE_PL_HERE_QX=25
val SCE_PL_STRING_Q=26
+val SCE_PL_STRING_QQ=27
+val SCE_PL_STRING_QX=28
+val SCE_PL_STRING_QR=29
+val SCE_PL_STRING_QW=30
# Lexical states for SCLEX_LATEX
val SCE_L_DEFAULT=0
val SCE_L_COMMAND=1
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index cdee673f2..33f2b3984 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -135,8 +135,14 @@ 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 || state == SCE_PL_STRING_Q) {
+ if ( state == SCE_PL_STRING_Q
+ || state == SCE_PL_STRING_QQ
+ || state == SCE_PL_STRING_QX
+ || state == SCE_PL_STRING_QR
+ || state == SCE_PL_STRING_QW
+ || state == SCE_PL_REGEX
+ || state == SCE_PL_REGSUBST
+ ) {
while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) {
startPos--;
}
@@ -228,7 +234,10 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
i++;
chNext = chNext2;
} else if (ch == 'q' && (chNext == 'q' || chNext == 'r' || chNext == 'w' || chNext == 'x') && !isalnum(chNext2)) {
- state = SCE_PL_LONGQUOTE;
+ if (chNext == 'q') state = SCE_PL_STRING_QQ;
+ else if (chNext == 'x') state = SCE_PL_STRING_QX;
+ else if (chNext == 'r') state = SCE_PL_STRING_QR;
+ else if (chNext == 'w') state = SCE_PL_STRING_QW;
i++;
chNext = chNext2;
quotes = 0;
@@ -523,7 +532,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
- } else if (state == SCE_PL_REGEX) {
+ } else if (state == SCE_PL_REGEX
+ || state == SCE_PL_STRING_QR
+ ) {
if (!quoteUp && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(ch);
@@ -621,7 +632,11 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
}
}
}
- } else if (state == SCE_PL_LONGQUOTE || state == SCE_PL_STRING_Q) {
+ } else if (state == SCE_PL_STRING_Q
+ || state == SCE_PL_STRING_QQ
+ || state == SCE_PL_STRING_QX
+ || state == SCE_PL_STRING_QW
+ ) {
if (!quoteDown && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(quoteUp);