@@ -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,27 @@ 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+ /**
444+ * Gets the key expression of this pair.
445+ */
446+ final ExprCfgNode getKey ( ) { e .hasCfgChild ( e .getKey ( ) , this , result ) }
447+
448+ /**
449+ * Gets the value expression of this pair.
450+ */
451+ final ExprCfgNode getValue ( ) { e .hasCfgChild ( e .getValue ( ) , this , result ) }
452+ }
453+
429454 /** A control-flow node that wraps a `VariableReadAccess` AST expression. */
430455 class VariableReadAccessCfgNode extends ExprCfgNode {
431456 override VariableReadAccess e ;
0 commit comments