aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2004-05-04 12:24:13 +0000
committernyamatongwe <devnull@localhost>2004-05-04 12:24:13 +0000
commit3af3c23f77c0f0a3356aa430ac84dbdfbe774f75 (patch)
treea8e78fd388b08f0f7a79fcd9573e3a39b888ece7
parent85b730e091325597d21c978208d2218e6eee42b6 (diff)
downloadscintilla-mirror-3af3c23f77c0f0a3356aa430ac84dbdfbe774f75.tar.gz
Support from Bruce Dodson for Lua tracebacks.
-rw-r--r--src/LexOthers.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx
index df02d16a9..1681ba5d4 100644
--- a/src/LexOthers.cxx
+++ b/src/LexOthers.cxx
@@ -528,6 +528,8 @@ static void ColouriseErrorListLine(
// Look for Microsoft <filename>(line) :message
// Look for Microsoft <filename>(line,pos)message
// Look for CTags \tmessage
+ // Look for Lua 5 traceback \t<filename>:<line>:message
+ bool initialTab = (lineBuffer[0] == '\t');
int state = 0;
for (unsigned int i = 0; i < lengthLine; i++) {
char ch = lineBuffer[i];
@@ -536,17 +538,17 @@ static void ColouriseErrorListLine(
chNext = lineBuffer[i+1];
if (state == 0) {
if (ch == ':') {
- // May be GCC
+ // May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix)
if ((chNext != '\\') && (chNext != '/')) {
// This check is not completely accurate as may be on
// GTK+ with a file name that includes ':'.
state = 1;
}
- } else if ((ch == '(') && Is1To9(chNext)) {
+ } else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) {
// May be Microsoft
// Check against '0' often removes phone numbers
state = 10;
- } else if (ch == '\t') {
+ } else if ((ch == '\t') && (!initialTab)) {
// May be CTags
state = 20;
}
@@ -599,7 +601,7 @@ static void ColouriseErrorListLine(
styler.ColourTo(endPos, SCE_ERR_GCC);
} else if ((state == 13) || (state == 14) || (state == 15)) {
styler.ColourTo(endPos, SCE_ERR_MS);
- } else if (((state == 22) || (state == 24)) && (lineBuffer[0] != '\t')) {
+ } else if ((state == 22) || (state == 24)) {
styler.ColourTo(endPos, SCE_ERR_CTAG);
} else {
styler.ColourTo(endPos, SCE_ERR_DEFAULT);