@@ -357,7 +357,9 @@ module Expressions {
357357 not this instanceof AndPatternExpr and
358358 not this instanceof RecursivePatternExpr and
359359 not this instanceof PositionalPatternExpr and
360- not this instanceof PropertyPatternExpr
360+ not this instanceof PropertyPatternExpr and
361+ not this instanceof PreIncrExpr and
362+ not this instanceof PreDecrExpr
361363 }
362364
363365 final override AstNode getChildNode ( int i ) { result = getExprChild ( this , i ) }
@@ -919,6 +921,54 @@ module Expressions {
919921 succ = this
920922 }
921923 }
924+
925+ private class PreIncrExprTree extends PostOrderTree instanceof PreIncrExpr {
926+ private Expr operand ;
927+
928+ PreIncrExprTree ( ) { operand = this .getOperand ( ) }
929+
930+ final override predicate propagatesAbnormal ( AstNode child ) { child = operand }
931+
932+ final override predicate first ( AstNode first ) { first ( operand , first ) }
933+
934+ final override predicate succ ( AstNode pred , AstNode succ , Completion c ) {
935+ (
936+ // Post-order: flow from last element of the operand to the element itself
937+ succ = this and
938+ last ( operand , pred , c ) and
939+ c instanceof NormalCompletion
940+ or
941+ // Flow from the last element in ++x to x
942+ succ = operand and
943+ last ( this , pred , c ) and
944+ c instanceof NormalCompletion
945+ )
946+ }
947+ }
948+
949+ private class PreDecrExprTree extends PostOrderTree instanceof PreDecrExpr {
950+ private Expr operand ;
951+
952+ PreDecrExprTree ( ) { operand = this .getOperand ( ) }
953+
954+ final override predicate propagatesAbnormal ( AstNode child ) { child = operand }
955+
956+ final override predicate first ( AstNode first ) { first ( operand , first ) }
957+
958+ final override predicate succ ( AstNode pred , AstNode succ , Completion c ) {
959+ (
960+ // Post-order: flow from last element of the operand to the element itself
961+ succ = this and
962+ last ( operand , pred , c ) and
963+ c instanceof NormalCompletion
964+ or
965+ // Flow from the last element in --x to x
966+ succ = operand and
967+ last ( this , pred , c ) and
968+ c instanceof NormalCompletion
969+ )
970+ }
971+ }
922972}
923973
924974private class RecursivePatternExprTree extends PostOrderTree instanceof RecursivePatternExpr {
0 commit comments