aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKåre Särs <[email protected]>2015-07-17 08:51:34 +0300
committerKåre Särs <[email protected]>2015-07-17 08:51:34 +0300
commit85c1a27cc4bd532ff77326f1cfa4c167cc97294b (patch)
treee7a543002ea49ef64d2ad583632f7a7ced342502
parentc76f452b8a913860ea6a26c18c23a3ef90db2e99 (diff)
Fix symbolviewer cpp_parser parsing of tabs in macros
+ add a test in testfile.c BUG: 331803
-rw-r--r--addons/symbolviewer/cpp_parser.cpp4
-rw-r--r--addons/symbolviewer/testfile.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/addons/symbolviewer/cpp_parser.cpp b/addons/symbolviewer/cpp_parser.cpp
index 362b5e0..5149f46 100644
--- a/addons/symbolviewer/cpp_parser.cpp
+++ b/addons/symbolviewer/cpp_parser.cpp
@@ -93,11 +93,11 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
macro = 2;
j += 6; // skip the word "define"
}
- if(macro == 2 && j<cl.length() &&cl.at(j) != QLatin1Char(' ')) macro = 3;
+ if(macro == 2 && j<cl.length() && cl.at(j) != QLatin1Char(' ') && cl.at(j) != QLatin1Char('\t')) macro = 3;
if(macro == 3)
{
if (cl.at(j) >= 0x20) stripped += cl.at(j);
- if (cl.at(j) == QLatin1Char(' ') || j == cl.length() - 1)
+ if (cl.at(j) == QLatin1Char(' ') || cl.at(j) == QLatin1Char('\t') || j == cl.length() - 1)
macro = 4;
}
//qDebug(13000)<<"Macro -- Stripped : "<<stripped<<" macro = "<<macro;
diff --git a/addons/symbolviewer/testfile.c b/addons/symbolviewer/testfile.c
index 8bc4cc0..0fe68cd 100644
--- a/addons/symbolviewer/testfile.c
+++ b/addons/symbolviewer/testfile.c
@@ -59,3 +59,9 @@ RockType *
// Test escaped quote
void test() { printf("foo \"\n"); }
void test2() { printf("foo \"\n"); }
+
+// Test tabs in macro
+#define MY_MACRO(x) foo(x)
+#define MY_MACRO2(x) foo(x)
+#define MY_MACRO3(x) foo(x)
+