Utilities/ModuleParser.py

changeset 6813
7f4cfe76b90c
parent 6735
31e263d49c04
child 6815
b1b833693a38
--- a/Utilities/ModuleParser.py	Sat Feb 23 19:11:05 2019 +0100
+++ b/Utilities/ModuleParser.py	Sat Feb 23 22:03:27 2019 +0100
@@ -59,14 +59,18 @@
 
 _py_getnext = re.compile(
     r"""
-    (?P<String>
-       \""" (?P<StringContents1>
+    (?P<Comment>
+        \#[^\n]*$   # Ignore triple quotes in comments
+    )
+    
+|   (?P<String>
+        \""" (?P<StringContents1>
                [^"\\]* (?:
                             (?: \\. | "(?!"") )
                             [^"\\]*
                         )*
             )
-       \"""
+        \"""
 
     |   ''' (?P<StringContents2>
                 [^'\\]* (?:
@@ -813,6 +817,9 @@
                 conditionalsstack.append(thisindent)
                 deltaindentcalculated = 0
             
+            elif m.start("Comment") >= 0:
+                pass
+            
             else:
                 assert 0, "regexp _getnext found something unexpected"
             

eric ide

mercurial