Utilities/ModuleParser.py

changeset 4465
2fbb5bdb8ddf
parent 4461
3634459f8011
child 4486
0538abbe71d0
diff -r 87cd9719dc23 -r 2fbb5bdb8ddf Utilities/ModuleParser.py
--- a/Utilities/ModuleParser.py	Sat Sep 19 12:12:19 2015 +0200
+++ b/Utilities/ModuleParser.py	Mon Sep 21 19:13:30 2015 +0200
@@ -58,7 +58,6 @@
         return -1
 
 
-# TODO: Add support for the new Python 3.5 async def
 _py_getnext = re.compile(
 r"""
     (?P<String>
@@ -135,7 +134,7 @@
         )?
         ^
         (?P<MethodIndent> [ \t]* )
-        def [ \t]+
+        (?: async [ \t]+ )? def [ \t]+
         (?P<MethodName> \w+ )
         (?: [ \t]* \[ (?: plain | html ) \] )?
         [ \t]* \(
@@ -194,7 +193,8 @@
 |   (?P<ConditionalDefine>
         ^
         (?P<ConditionalDefineIndent> [ \t]* )
-        (?: (?: if | elif ) [ \t]+ [^:]* | else [ \t]* ) : (?= \s* def)
+        (?: (?: if | elif ) [ \t]+ [^:]* | else [ \t]* ) :
+        (?= \s* (?: async [ \t]+ )? def)
     )""",
     re.VERBOSE | re.DOTALL | re.MULTILINE).search
 

eric ide

mercurial