Skip to content

Commit 86a9def

Browse files
committed
misc.py: removed bailouts
1 parent 795f244 commit 86a9def

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

addons/misc.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ def stringConcatInArrayInit(rawTokens):
6363
elif tok1 == ']' and tok2 == '=' and tok3 == '{':
6464
arrayInit = True
6565
elif arrayInit and (tok1 in [',', '{']) and isStringLiteral(tok2) and isStringLiteral(tok3):
66-
if tok1 == '{':
67-
i2 = i + 1
68-
while i2 < len(rawTokens) and rawTokens[i2].str not in [',', '}']:
69-
i2 = i2 + 1
70-
if i2 >= len(rawTokens) or rawTokens[i2].str != ',':
71-
continue
72-
if i + 2 < len(rawTokens) and isStringLiteral(rawTokens[i+1].str) and isStringLiteral(rawTokens[i+2].str):
73-
continue
7466
reportError(rawTokens[i], 'style', 'String concatenation in array initialization, missing comma?', 'stringConcatInArrayInit')
7567

7668
def implicitlyVirtual(data):

addons/test/misc-test.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,8 @@
33

44

55
// Warn about string concatenation in array initializers..
6-
const char *a[] = {"a" "b"};
6+
const char *a[] = {"a" "b"}; // stringConcatInArrayInit
77
const char *b[] = {"a","b" "c"}; // stringConcatInArrayInit
8-
const char *c[] = {
9-
"a\n"
10-
"a\n"
11-
"a\n"
12-
"a\n"
13-
"a\n"
14-
,
15-
"b\n"
16-
"b\n"
17-
"b\n"
18-
"b\n"
19-
"b\n"
20-
};
218

229

2310
// Function is implicitly virtual

0 commit comments

Comments
 (0)