This commit is contained in:
Tan, Kian-ting 2021-06-20 23:45:08 +08:00
parent a33fa666b6
commit 3e781737e4

View file

@ -168,10 +168,12 @@ class ClochurLexer(QsciLexerCustom):
# string
elif re.match(tmp_parser.string_pattern ,item["str"]):
new_state = self.String
elif re.match(r"[\"]([^\"\\]|[\\][\"nt]|[\\][\\])+?", item["str"]):
elif (re.match(r"[\"]([^\"\\]|[\\][\"nt]|[\\][\\])+?", item["str"]) or re.match(r'["]' ,item["str"])) \
and rainbow_state < 10:
rainbow_state += 10
new_state = self.String
elif (re.match(r"([^\"\\]|[\\][\"nt]|[\\][\\])+?[\"]" ,item["str"]) or re.match(r'["]' ,item["str"])):
elif (re.match(r"([^\"\\]|[\\][\"nt]|[\\][\\])+?[\"]" ,item["str"]) or re.match(r'["]' ,item["str"])) \
and rainbow_state >= 10:
new_state = self.String
rainbow_state -= 10