Add ** to match until in addons (#4353)

This commit is contained in:
Paul Fultz II 2022-08-16 12:05:37 -05:00 committed by GitHub
parent 38c7d0a5f8
commit a8c1cdca57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -1382,9 +1382,18 @@ def match_atom(token, p):
if t: if t:
return t return t
elif p.startswith('!!'): elif p.startswith('!!'):
t = match_atom(token, p[1:]) t = match_atom(token, p[2:])
if not t: if not t:
return token return token
elif p.startswith('**'):
a = p[2:]
t = token
while t:
if match_atom(t, a):
return t
if t.link and t.str in ['(', '[', '<', '{']:
t = t.link
t = t.next
return None return None
class MatchResult: class MatchResult: