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
We can easily know which extractors are needed using `Printer.TreeStructure.show`, which returns the string representation the structure of the tree. Other printers can also be found in the `Printer` module.
56
+
We can easily know which extractors are needed using `Printer.TreeStructure.show`,
57
+
which returns the string representation the structure of the tree. Other printers
58
+
can also be found in the `Printer` module.
58
59
59
60
```scala
60
61
xTree.show(usingPrinter.TreeStructure)
61
62
// or
62
63
Printer.TreeStructure.show(xTree)
63
64
```
64
65
65
-
66
-
The methods `quotes.reflect.Term.{asExpr, asExprOf}` provide a way to go back to a `quoted.Expr`.
67
-
Note that `asExpr` returns a `Expr[Any]`.
68
-
On the other hand `asExprOf[T]` returns a `Expr[T]`, if the type does not conform to it an exception will be thrown at runtime.
69
-
66
+
The methods `quotes.reflect.Term.{asExpr, asExprOf}` provide a way to go back to
67
+
a `quoted.Expr`. Note that `asExpr` returns a `Expr[Any]`. On the other hand
68
+
`asExprOf[T]` returns a `Expr[T]`, if the type does not conform to it an exception
69
+
will be thrown at runtime.
70
70
71
71
### Positions
72
72
73
-
The `ast` in the context provides a `rootPosition` value. It corresponds to
74
-
the expansion site for macros. The macro authors can obtain various information about that
75
-
expansion site. The example below shows how we can obtain position information
76
-
such as the start line, the end line or even the source code at the expansion
77
-
point.
73
+
The `Position` in the context provides an `ofMacroExpansion` value. It corresponds
74
+
to the expansion site for macros. The macro authors can obtain various information
75
+
about that expansion site. The example below shows how we can obtain position
76
+
information such as the start line, the end line or even the source code at the
0 commit comments