@@ -320,7 +320,11 @@ module ExprNodes {
320
320
321
321
/** Gets the the keyword argument whose key is `keyword` of this call. */
322
322
final ExprCfgNode getKeywordArgument ( string keyword ) {
323
- e .hasCfgChild ( e .getKeywordArgument ( keyword ) , this , result )
323
+ exists ( PairCfgNode n |
324
+ e .hasCfgChild ( e .getAnArgument ( ) , this , n ) and
325
+ n .getKey ( ) .getExpr ( ) .( SymbolLiteral ) .getValueText ( ) = keyword and
326
+ result = n .getValue ( )
327
+ )
324
328
}
325
329
326
330
/** Gets the number of arguments of this call. */
@@ -426,6 +430,21 @@ module ExprNodes {
426
430
ParenthesizedExprCfgNode ( ) { this .getExpr ( ) instanceof ParenthesizedExpr }
427
431
}
428
432
433
+ private class PairChildMapping extends ExprChildMapping , Pair {
434
+ override predicate relevantChild ( Expr e ) { e = this .getKey ( ) or e = this .getValue ( ) }
435
+ }
436
+
437
+ /** A control-flow node that wraps a `Pair` AST expression. */
438
+ class PairCfgNode extends ExprCfgNode {
439
+ override PairChildMapping e ;
440
+
441
+ final override Pair getExpr ( ) { result = ExprCfgNode .super .getExpr ( ) }
442
+
443
+ final ExprCfgNode getKey ( ) { e .hasCfgChild ( e .getKey ( ) , this , result ) }
444
+
445
+ final ExprCfgNode getValue ( ) { e .hasCfgChild ( e .getValue ( ) , this , result ) }
446
+ }
447
+
429
448
/** A control-flow node that wraps a `VariableReadAccess` AST expression. */
430
449
class VariableReadAccessCfgNode extends ExprCfgNode {
431
450
override VariableReadAccess e ;
0 commit comments