From 2d9178bedd7f3e269e0fe5f6eecf8390a2b7f7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20G=2E=20Chajdas?= Date: Sat, 13 Nov 2021 21:08:10 +0100 Subject: Handle ' and " in the repeated token script. --- scripts/check_repeated_token.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') 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') -- cgit v1.2.1