aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tidy.py')
-rw-r--r--python/tidy.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/tidy.py b/python/tidy.py
index 2841d956a18..347a884ccb3 100644
--- a/python/tidy.py
+++ b/python/tidy.py
@@ -291,7 +291,7 @@ def check_rust(file_name, lines):
# get rid of strings and chars because cases like regex expression, keep attributes
if not line_is_attribute(line):
- line = re.sub('".*?"|\'.*?\'', '', line)
+ line = re.sub(r'"(\\.|[^\\"])*?"|' + r"'(\\.|[^\\'])*?'", '', line)
# get rid of comments
line = re.sub('//.*?$|/\*.*?$|^\*.*?$', '', line)
@@ -347,6 +347,7 @@ def check_rust(file_name, lines):
for match in re.finditer(pattern, line):
if not filter_func(match, line):
continue
+
yield (idx + 1, message.format(*match.groups(), **match.groupdict()))
# check alphabetical order of extern crates