Convert

sbt.internal.util.appmacro.Convert
trait Convert[C <: Quotes & Singleton](val qctx: C) 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

Concise view

Type members

Classlikes

Attributes

Companion:
object
Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
object Converted

Attributes

Companion:
enum
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Inherited classlikes

Attributes

Inherited from:
ContextUtil
Graph
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
Graph
Supertypes
class Object
trait Matchable
class Any
trait TermTransform[F[_]]

Attributes

Inherited from:
ContextUtil
Graph
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 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

Constructs a new, synthetic, local var with type tpe, a unique name, initialized to zero-equivalent (Zero[A]), and owned by parent.

Constructs a new, synthetic, local var with type tpe, a unique name, initialized to zero-equivalent (Zero[A]), and owned by parent.

Attributes

Inherited from:
ContextUtil

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

Concrete fields

override val qctx: C

Inherited fields

val valStart: Int

Attributes

Inherited from:
ContextUtil

Givens

Inherited givens

Attributes

Inherited from:
ContextUtil