Skip to content

Commit a8c1cdc

Browse files
authored
Add ** to match until in addons (danmar#4353)
1 parent 38c7d0a commit a8c1cdc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

addons/cppcheckdata.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,9 +1382,18 @@ def match_atom(token, p):
13821382
if t:
13831383
return t
13841384
elif p.startswith('!!'):
1385-
t = match_atom(token, p[1:])
1385+
t = match_atom(token, p[2:])
13861386
if not t:
13871387
return token
1388+
elif p.startswith('**'):
1389+
a = p[2:]
1390+
t = token
1391+
while t:
1392+
if match_atom(t, a):
1393+
return t
1394+
if t.link and t.str in ['(', '[', '<', '{']:
1395+
t = t.link
1396+
t = t.next
13881397
return None
13891398

13901399
class MatchResult:

0 commit comments

Comments
 (0)