Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py

changeset 6107
78dabf542c6b
parent 6048
82ad8ec9548c
child 6108
59cf5a66b0b3
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sat Feb 03 16:46:32 2018 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sat Feb 03 17:34:19 2018 +0100
@@ -26,10 +26,16 @@
 except ImportError:
     pass
 
-VcsConflictMarkerRe = re.compile(
-    r"""^<<<<<<< .*?=======.*?>>>>>>> .*?$""",
-    re.MULTILINE | re.DOTALL)
-
+VcsConflictMarkerRegExpList = (
+    re.compile(
+        r"""^<<<<<<< .*?=======.*?>>>>>>> .*?$""",
+        re.MULTILINE | re.DOTALL
+    ),
+    re.compile(
+        r"""^<<<<<<< .*?||||||| .?=======.*?>>>>>>> .*?$""",
+        re.MULTILINE | re.DOTALL
+    )
+)
 
 def initService():
     """
@@ -236,14 +242,15 @@
         codestring = normalizeCode(codestring)
         
         # Check for VCS conflict markers
-        conflict = VcsConflictMarkerRe.search(codestring)
-        if conflict is not None:
-            start, i = conflict.span()
-            lineindex = 1 + codestring.count("\n", 0, start)
-            return [{'error':
-                     (file_enc, lineindex, 0, "",
-                      "VCS conflict marker found")
-                     }]
+        for conflictMarkerRe in VcsConflictMarkerRegExpList:
+            conflict = conflictMarkerRe.search(codestring)
+            if conflict is not None:
+                start, i = conflict.span()
+                lineindex = 1 + codestring.count("\n", 0, start)
+                return [{'error':
+                         (file_enc, lineindex, 0, "",
+                          "VCS conflict marker found")
+                         }]
         
         if filename.endswith('.ptl'):
             try:

eric ide

mercurial