@@ -49,7 +49,11 @@ class Function extends Function_, Scope, AstNode {
4949 string getArgName ( int index ) { result = this .getArg ( index ) .( Name ) .getId ( ) }
5050
5151 Parameter getArgByName ( string name ) {
52- result = this .getAnArg ( ) and
52+ (
53+ result = this .getAnArg ( )
54+ or
55+ result = this .getAKeywordOnlyArg ( )
56+ ) and
5357 result .( Name ) .getId ( ) = name
5458 }
5559
@@ -102,6 +106,7 @@ class Function extends Function_, Scope, AstNode {
102106 result = this .getAStmt ( ) or
103107 result = this .getAnArg ( ) or
104108 result = this .getVararg ( ) or
109+ result = this .getAKeywordOnlyArg ( ) or
105110 result = this .getKwarg ( )
106111 }
107112
@@ -185,6 +190,8 @@ class Parameter extends Parameter_ {
185190 f .getVararg ( ) = this
186191 or
187192 f .getKwarg ( ) = this
193+ or
194+ f .getAKeywordOnlyArg ( ) = this
188195 )
189196 }
190197
@@ -322,11 +329,14 @@ class Lambda extends Lambda_, CallableExpr {
322329 * that is generally only used for type hints today (PEP 484).
323330 */
324331class Arguments extends Arguments_ {
332+
325333 Expr getASubExpression ( ) {
334+ result = this .getADefault ( ) or
326335 result = this .getAKwDefault ( ) or
336+ //
327337 result = this .getAnAnnotation ( ) or
328- result = this .getKwargannotation ( ) or
329338 result = this .getVarargannotation ( ) or
330- result = this .getADefault ( )
339+ result = this .getAKwAnnotation ( ) or
340+ result = this .getKwargannotation ( )
331341 }
332342}
0 commit comments