##// END OF EJS Templates
check-config: use compiled regexp...
Gregory Szorc -
r32847:e5a6a540 default
parent child Browse files
Show More
@@ -14,8 +14,16 b' import sys'
14 foundopts = {}
14 foundopts = {}
15 documented = {}
15 documented = {}
16
16
17 configre = (r"""ui\.config(|int|bool|list)\(['"](\S+)['"],\s*"""
17 configre = re.compile(r'''
18 r"""['"](\S+)['"](,\s+(?:default=)?(\S+?))?\)""")
18 # Function call
19 ui\.config(|int|bool|list)\(
20 # First argument.
21 ['"](\S+)['"],\s*
22 # Second argument
23 ['"](\S+)['"](,\s+
24 (?:default=)?(\S+?))?
25 \)''', re.VERBOSE | re.MULTILINE)
26
19 configpartialre = (r"""ui\.config""")
27 configpartialre = (r"""ui\.config""")
20
28
21 def main(args):
29 def main(args):
@@ -71,7 +79,7 b' def main(args):'
71
79
72 # look for code-like bits
80 # look for code-like bits
73 line = carryover + l
81 line = carryover + l
74 m = re.search(configre, line, re.MULTILINE)
82 m = configre.search(line)
75 if m:
83 if m:
76 ctype = m.group(1)
84 ctype = m.group(1)
77 if not ctype:
85 if not ctype:
General Comments 0
You need to be logged in to leave comments. Login now