aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-11-08 23:28:16 +0000
committernyamatongwe <unknown>2000-11-08 23:28:16 +0000
commit36c6685e82b72b1f93adac5caf26dfc9dc56fd9b (patch)
tree57bd504aacfb9a0f081f1bd8416ca3aa53b8b105
parent36849951c6c20b566ba2dcf1b47bb8e157c480e5 (diff)
downloadscintilla-mirror-36c6685e82b72b1f93adac5caf26dfc9dc56fd9b.tar.gz
Patch from Steffen for regex.
-rw-r--r--src/LexPerl.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index a7186fe55..7bc08f333 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -380,8 +380,13 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
quoteUp = ch;
quoteDown = opposite(ch);
quotes++;
+ } else if (ch == '\\' && quoteUp != '\\') {
+ // SG: Is it save to skip *every* escaped char?
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
} else {
- if (ch == quoteDown && chPrev != '\\') {
+ if (ch == quoteDown /*&& chPrev != '\\'*/) {
quotes--;
if (quotes == 0) {
quoteRep--;
@@ -396,7 +401,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
ch = ' ';
}
}
- } else if (ch == quoteUp && chPrev != '\\') {
+ } else if (ch == quoteUp /*&& chPrev != '\\'*/) {
quotes++;
} else if (!isalpha(chNext)) {
if (quoteRep <= 0) {
@@ -411,6 +416,11 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
quoteUp = ch;
quoteDown = opposite(ch);
quotes++;
+ } else if (ch == '\\' && quoteUp != '\\') {
+ // SG: Is it save to skip *every* escaped char?
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
} else {
if (quotes == 0 && quoteRep == 1) {
/* We matched something like s(...) or tr{...}
@@ -437,7 +447,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
quoteDown = opposite(ch);
quotes++;
}
- } else if (ch == quoteDown && chPrev != '\\') {
+ } else if (ch == quoteDown /*&& chPrev != '\\'*/) {
quotes--;
if (quotes == 0) {
quoteRep--;
@@ -452,7 +462,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
if (quoteUp == quoteDown) {
quotes++;
}
- } else if (ch == quoteUp && chPrev != '\\') {
+ } else if (ch == quoteUp /*&& chPrev != '\\'*/) {
quotes++;
} else if (!isalpha(chNext)) {
if (quoteRep <= 0) {