You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also easily check the shape of code by printing out quoted code transformed into a Term:
91
+
You can also check the shape of code by printing out quoted code transformed into a Term:
92
92
```scala
93
-
println( `{ scalaCode }.asTerm )
93
+
println( '{ scalaCode }.asTerm )
94
94
```
95
95
Bear in mind this will always produce a Term. E.g.:
96
96
```scala
@@ -139,7 +139,7 @@ Bear in mind that extractors and constructors for the same trees might be compri
139
139
has `(Symbol, Option[Term])` arguments and `unapply` has `(String, TypeTree, Option[Term])` (if we want to obtain the symbol directly, we can call `.symbol` on the `ValDef`).
140
140
141
141
### Symbols
142
-
To construct definition `Trees` we might have to create or use a `Symbol`. Symbols represent the „named” parts of the code, the declarations we can reference elsewhere later. Let’s try to create `val name: Int = 0` from scratch.
142
+
To construct definition `Trees` we might have to create or use a `Symbol`. Symbols represent the "named" parts of the code, the declarations we can reference elsewhere later. Let’s try to create `val name: Int = 0` from scratch.
143
143
To create a val like this, we need to first create a `Symbol` that matches the intended `Tree` type, so for a `ValDef` we would use the `Symbol.newVal` method:
144
144
```scala
145
145
importquotes.reflect._
@@ -249,7 +249,7 @@ and methods on instances of `Select` would be found in `SelectMethods`.
249
249
250
250
### Positions
251
251
252
-
The `Position` in the `quotes.reflect._` provides an `ofMacroExpansion` value. It corresponds
252
+
The `Position` in the `quotes.reflect.*` provides an `ofMacroExpansion` value. It corresponds
253
253
to the expansion site for macros. The macro authors can obtain various information
254
254
about that expansion site. The example below shows how we can obtain position
255
255
information such as the start line, the end line or even the source code at the
0 commit comments