@@ -320,7 +320,11 @@ module ExprNodes {
320320
321321 /** Gets the the keyword argument whose key is `keyword` of this call. */
322322 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+ )
324328 }
325329
326330 /** Gets the number of arguments of this call. */
@@ -426,6 +430,21 @@ module ExprNodes {
426430 ParenthesizedExprCfgNode ( ) { this .getExpr ( ) instanceof ParenthesizedExpr }
427431 }
428432
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+
429448 /** A control-flow node that wraps a `VariableReadAccess` AST expression. */
430449 class VariableReadAccessCfgNode extends ExprCfgNode {
431450 override VariableReadAccess e ;
0 commit comments