Convert

sbt.internal.util.appmacro.Convert
trait Convert[C <: Quotes & Singleton] extends ContextUtil[C]

Convert is a glorified partial function to scan through the AST for the purpose of substituting the matching term with something else.

This is driven by calling transformWrappers(...) method. The filtering is limited to the shape of code matched using appTransformer, which is a generic function with a single type param and a single term param like X.wrapInit[A](...).

Attributes

Graph
Supertypes
trait ContextUtil[C]
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

enum Converted

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
case Success
case Failure
object Converted

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Converted.type

Inherited classlikes

Attributes

Inherited from:
ContextUtil
Supertypes
class Object
trait Matchable
class Any
final class Input(val tpe: TypeRepr, val qual: Term, val term: Term, val name: String)

Attributes

Inherited from:
ContextUtil
Supertypes
class Object
trait Matchable
class Any
final class Output(val tpe: TypeRepr, val term: Term, val name: String, val parent: Symbol)

Represents an output expression via Def.declareOutput

Represents an output expression via Def.declareOutput

Attributes

Inherited from:
ContextUtil
Supertypes
class Object
trait Matchable
class Any
trait TermTransform[F[_]]

Attributes

Inherited from:
ContextUtil
Supertypes
class Object
trait Matchable
class Any

Value members

Abstract methods

def convert[A : Type](nme: String, in: Term): Converted

Concrete methods

def asPredicate: (String, TypeRepr, Term) => Boolean
def transformWrappers(tree: Term, subWrapper: [a] => (x$1: String, x$2: Type[a], x$3: Term, x$4: Term) => Converted, owner: Symbol): Term

Substitutes wrappers in tree t with the result of subWrapper. A wrapper is a Tree of the form f[T](v) for which isWrapper( , , .target) returns true. Typically, f is a Select or Ident. The wrapper is replaced with the result of subWrapper(<Type of T>, <Tree of v>, <wrapper Tree>)

Substitutes wrappers in tree t with the result of subWrapper. A wrapper is a Tree of the form f[T](v) for which isWrapper( , , .target) returns true. Typically, f is a Select or Ident. The wrapper is replaced with the result of subWrapper(<Type of T>, <Tree of v>, <wrapper Tree>)

Attributes

Inherited methods

def applyTuple(tupleTerm: Term, tpe: TypeRepr, idx: Int): Term

Attributes

Inherited from:
ContextUtil
def collectDefs(tree: Term, isWrapper: (String, TypeRepr, Term) => Boolean): Set[Symbol]

Attributes

Inherited from:
ContextUtil
def freshName(prefix: String): String

Attributes

Inherited from:
ContextUtil
def freshValDef(parent: Symbol, tpe: TypeRepr, rhs: Term): ValDef

Attributes

Inherited from:
ContextUtil
def idTransform[F[_]]: TermTransform[F]

Attributes

Inherited from:
ContextUtil
def makeTuple(inputs: List[Input]): BuilderResult

Attributes

Inherited from:
ContextUtil
def tupleTypeRepr(param: List[TypeRepr]): TypeRepr

Attributes

Inherited from:
ContextUtil
def typed[A : Type](value: Term): Term

Attributes

Inherited from:
ContextUtil

Inherited fields

val qctx: C

Attributes

Inherited from:
ContextUtil
val valStart: Int

Attributes

Inherited from:
ContextUtil

Givens

Inherited givens

given given_qctx_type: C

Attributes

Inherited from:
ContextUtil