eric6/Utilities/ModuleParser.py

changeset 8131
f2129bb79269
parent 8099
522946e53835
child 8142
43248bafe9b2
child 8205
4a0f1f896341
diff -r 5fe4ff181b68 -r f2129bb79269 eric6/Utilities/ModuleParser.py
--- a/eric6/Utilities/ModuleParser.py	Tue Feb 23 17:31:36 2021 +0100
+++ b/eric6/Utilities/ModuleParser.py	Tue Feb 23 17:38:12 2021 +0100
@@ -37,6 +37,7 @@
     "Python": PY_SOURCE,
     "Python3": PY_SOURCE,
     "MicroPython": PY_SOURCE,
+    "Cython": PY_SOURCE,
     "Ruby": RB_SOURCE,
 }
 
@@ -134,7 +135,7 @@
         )?
         ^
         (?P<MethodIndent> [ \t]* )
-        (?: async [ \t]+ )? def [ \t]+
+        (?: async [ \t]+ )? (?: cdef | cpdef | def) [ \t]+
         (?P<MethodName> \w+ )
         (?: [ \t]* \[ (?: plain | html ) \] )?
         [ \t]* \(
@@ -147,6 +148,7 @@
 |   (?P<Class>
         ^
         (?P<ClassIndent> [ \t]* )
+        (?: cdef [ \t]+ )?
         class [ \t]+
         (?P<ClassName> \w+ )
         [ \t]*
@@ -175,7 +177,7 @@
     )
 
 |   (?P<Import>
-        ^ [ \t]* (?: import | from [ \t]+ \. [ \t]+ import ) [ \t]+
+        ^ [ \t]* (?: c? import | from [ \t]+ \. [ \t]+ c? import ) [ \t]+
         (?P<ImportList> (?: [^#;\\\n]* (?: \\\n )* )* )
     )
 
@@ -188,7 +190,7 @@
             )*
         )
         [ \t]+
-        import [ \t]+
+        c? import [ \t]+
         (?P<ImportFromList>
             (?: \( \s* .*? \s* \) )
             |

eric ide

mercurial