All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.getquill.ast.Transform.scala Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
package io.getquill.ast

class Transform[T](p: PartialFunction[Ast, Ast])
  extends StatelessTransformer {

  override def apply(a: Ast) =
    a match {
      case a if (p.isDefinedAt(a)) => p(a)
      case other                   => super.apply(other)
    }
}

object Transform {
  def apply[T](a: Ast)(p: PartialFunction[Ast, Ast]): Ast =
    new Transform(p).apply(a)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy