From 3e781737e46e5fca9f4eb610792055d34d8b74b3 Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Sun, 20 Jun 2021 23:45:08 +0800 Subject: [PATCH] fix issue #1 --- src/Clochur/ClochurLexer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Clochur/ClochurLexer.py b/src/Clochur/ClochurLexer.py index 3f3e760..d8df755 100644 --- a/src/Clochur/ClochurLexer.py +++ b/src/Clochur/ClochurLexer.py @@ -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