aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexOthers.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-05-09 09:54:03 +1000
committernyamatongwe <devnull@localhost>2011-05-09 09:54:03 +1000
commita14ce3521dade292378b6dce904010bb5b8223a4 (patch)
treeb161baecde37afa2471b2c65f57eea10afb93542 /lexers/LexOthers.cxx
parentc13ce7ecfa8722a3504f0bb4e4aa348418f9e0b4 (diff)
downloadscintilla-mirror-a14ce3521dade292378b6dce904010bb5b8223a4.tar.gz
Allow nested variables in make files. Bug #3298223.
From Dimitar Zhekov.
Diffstat (limited to 'lexers/LexOthers.cxx')
-rw-r--r--lexers/LexOthers.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/lexers/LexOthers.cxx b/lexers/LexOthers.cxx
index 2062b1b18..7d0f099bb 100644
--- a/lexers/LexOthers.cxx
+++ b/lexers/LexOthers.cxx
@@ -854,13 +854,17 @@ static void ColouriseMakeLine(
styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
return;
}
+ int varCount = 0;
while (i < lengthLine) {
if (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(') {
styler.ColourTo(startLine + i - 1, state);
state = SCE_MAKE_IDENTIFIER;
+ varCount++;
} else if (state == SCE_MAKE_IDENTIFIER && lineBuffer[i] == ')') {
- styler.ColourTo(startLine + i, state);
- state = SCE_MAKE_DEFAULT;
+ if (--varCount == 0) {
+ styler.ColourTo(startLine + i, state);
+ state = SCE_MAKE_DEFAULT;
+ }
}
// skip identifier and target styling if this is a command line