diff options
author | nyamatongwe <devnull@localhost> | 2000-11-08 23:28:16 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-11-08 23:28:16 +0000 |
commit | 3b0138cc5fdd87143fdce276a505453d9ebc35b2 (patch) | |
tree | 57bd504aacfb9a0f081f1bd8416ca3aa53b8b105 /src | |
parent | ad252a3c0e0f2b94139aec8a97a4e7b16831a655 (diff) | |
download | scintilla-mirror-3b0138cc5fdd87143fdce276a505453d9ebc35b2.tar.gz |
Patch from Steffen for regex.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexPerl.cxx | 18 |
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) { |