Skip to content

Commit 7125fce

Browse files
committed
Homogenize abstract module naming and add docs
1 parent 121ced4 commit 7125fce

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
7777
}
7878
end extension
7979

80-
object reflect extends Reflection:
80+
object reflect extends reflectModule:
8181

8282
type Tree = tpd.Tree
8383

library/src/scala/quoted/Quotes.scala

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,25 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
6666
def asExprOf(using Type[X]): Expr[X]
6767
end extension
6868

69-
/** Low-level Typed AST API metaprogramming API.
70-
* This API does not have the static type guarantiees that `Expr` and `Type` provide.
69+
/** Low-level Typed AST metaprogramming API.
70+
*
71+
* Provides all functionality related with AST based metaprogramming.
72+
*
73+
* Usage:
74+
* ```scala
75+
* def f(expr: Expr[Int])(using Quotes) =
76+
* import quotes.reflect._
77+
* val tree: Tree = Term.of(expr)
78+
* ...
79+
* ```
80+
*
81+
* See `reflectModule` for full API.
82+
*
83+
* @syntax markdown
7184
*/
72-
val reflect: Reflection
85+
val reflect: reflectModule
7386

74-
/** AST reflection interface.
87+
/** Low-level Typed AST metaprogramming API.
7588
*
7689
* Provides all functionality related with AST based metaprogramming.
7790
*
@@ -184,7 +197,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
184197
*
185198
* @syntax markdown
186199
*/
187-
trait Reflection { self: reflect.type =>
200+
trait reflectModule { self: reflect.type =>
188201

189202
///////////////
190203
// TREES //
@@ -3013,7 +3026,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
30133026
* It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing
30143027
* this symbol to the ValDef constructor.
30153028
*
3016-
* Note: Also see Reflection.let
3029+
* Note: Also see reflect.let
30173030
*
30183031
* @param flags extra flags to with which the symbol should be constructed
30193032
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
@@ -3768,7 +3781,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
37683781
// UTILS //
37693782
///////////////
37703783

3771-
/** TASTy Reflect tree accumulator.
3784+
/** Customizable Tree accumulator.
37723785
*
37733786
* Usage:
37743787
* ```
@@ -3871,7 +3884,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
38713884
end TreeAccumulator
38723885

38733886

3874-
/** TASTy Reflect tree traverser.
3887+
/** Customizable tree traverser.
38753888
*
38763889
* Usage:
38773890
* ```
@@ -3891,7 +3904,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
38913904

38923905
end TreeTraverser
38933906

3894-
/** TASTy Reflect tree map.
3907+
/** Customizable tree mapper.
38953908
*
38963909
* Usage:
38973910
* ```

0 commit comments

Comments
 (0)