summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2021-11-13 21:08:10 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2021-11-13 21:08:10 +0100
commit2d9178bedd7f3e269e0fe5f6eecf8390a2b7f7d7 (patch)
treea7053d0a3d57a42dcbc7bf88112f7ab7d249f4e3 /scripts
parent337dddef92b69d3a1e88fa450bef55149d24c1d9 (diff)
downloadpygments-git-2d9178bedd7f3e269e0fe5f6eecf8390a2b7f7d7.tar.gz
Handle ' and " in the repeated token script.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_repeated_token.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/check_repeated_token.py b/scripts/check_repeated_token.py
index 60e42704..e747357a 100755
--- a/scripts/check_repeated_token.py
+++ b/scripts/check_repeated_token.py
@@ -38,8 +38,10 @@ def unpack_file(path):
for line in open(path).readlines():
line = line.strip()
if line:
- quotation_start = line.find('\'')
- quotation_end = line.rfind('\'')
+ # Line can start with ' or ", so let's check which one it is
+ # and find the matching one
+ quotation_start = 0
+ quotation_end = line.rfind(line[0])
text = line[quotation_start+1:quotation_end]
token = line.split()[-1]
text = text.replace('\\n', '\n')