Skip to content

Commit

Permalink
Add missing change
Browse files Browse the repository at this point in the history
  • Loading branch information
7i6ht committed Feb 4, 2025
1 parent a53b1ba commit 3c04dd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/viper/silver/parser/ParseAst.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ trait PNode extends Where with Product with Rewritable with HasExtraValList {
def deepCollect[A](f: PartialFunction[PNode, A]): Seq[A] =
Visitor.deepCollect(Seq(this), PNode.callSubnodes)(f)

/** Same as deep collect except that subnodes are visited only if f1 returns true at the current node */
def deepCollectOpt[A](f1: PNode => Boolean, f2: PartialFunction[PNode, A]): Seq[A] =
Visitor.deepCollect(Seq(this), (n : PNode) => if (f1(n)) PNode.callSubnodes(n) else Seq.empty)(f2)

/** @see [[Visitor.shallowCollect()]] */
def shallowCollect[R](f: PartialFunction[PNode, R]): Seq[R] =
Visitor.shallowCollect(Seq(this), PNode.callSubnodes)(f)
Expand Down

0 comments on commit 3c04dd6

Please sign in to comment.