diff options
author | Mob <a-yoshiyama@nec.com> | 2021-01-15 10:19:49 (GMT) |
---|---|---|
committer | Mob <a-yoshiyama@nec.com> | 2021-01-18 06:30:45 (GMT) |
commit | abffb84e0420deb5175cf1fb3f50949abf0c3b05 (patch) | |
tree | 43a1d5922768c97943f1804deeaf53d1a3636e2b /src | |
parent | 31709395a2ab12ba137e87cf4d8b70f2cada8396 (diff) | |
download | Doxygen-abffb84e0420deb5175cf1fb3f50949abf0c3b05.zip Doxygen-abffb84e0420deb5175cf1fb3f50949abf0c3b05.tar.gz Doxygen-abffb84e0420deb5175cf1fb3f50949abf0c3b05.tar.bz2 |
issue #8336 Python class only with async methods support
Diffstat (limited to 'src')
-rw-r--r-- | src/pycode.l | 8 | ||||
-rw-r--r-- | src/pyscanner.l | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/pycode.l b/src/pycode.l index 65788cc..0362de4 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -190,7 +190,7 @@ SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ}) SHORTSTRINGCHAR [^\\\n"] STRINGLITERAL {STRINGPREFIX}?( {SHORTSTRING} | {LONGSTRING}) STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR") -KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"def"|"True"|"False") +KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"async"|"def"|"True"|"False") FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally") QUOTES ("\""[^"]*"\"") SINGLEQUOTES ("'"[^']*"'") @@ -302,6 +302,12 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU endFontClass(yyscanner); BEGIN( FunctionDec ); } + "async"{BB}"def"{BB} { + startFontClass(yyscanner,"keyword"); + codify(yyscanner,yytext); + endFontClass(yyscanner); + BEGIN( FunctionDec ); + } "class"{BB} { startFontClass(yyscanner,"keyword"); diff --git a/src/pyscanner.l b/src/pyscanner.l index 4a9552e..96d62ca 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -261,10 +261,20 @@ STARTDOCSYMS "##" searchFoundDef(yyscanner); BEGIN( FunctionDec ); } + ^{B}"async"{BB}"def"{BB} { // start of an async function/method definition with indent + DBG_CTX((stderr,"Found async def at %d\n",yyextra->yyLineNr)); + yyextra->indent=computeIndent(yytext); + searchFoundDef(yyscanner); + BEGIN( FunctionDec ); + } "def"{BB} { // start of a function/method definition searchFoundDef(yyscanner); BEGIN( FunctionDec ); } + "async"{BB}"def"{BB} { // start of a function/method definition + searchFoundDef(yyscanner); + BEGIN( FunctionDec ); + } ^{B}"class"{BB} { // start of a class definition with indent DBG_CTX((stderr,"Found class at %d\n",yyextra->yyLineNr)); |