-
Notifications
You must be signed in to change notification settings - Fork 20
/
AsyncMacroFlags.scala
39 lines (30 loc) · 1.05 KB
/
AsyncMacroFlags.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package cps.macros
import scala.quoted._
import misc._
case class AsyncMacroFlags(
printCode: Boolean = false,
printTree: Boolean = false,
debugLevel: Int = 0,
allowShiftedLambda: Boolean = true,
muted: Boolean = false,
useLoomAwait: Boolean = false
)
object AsyncMacroFlags:
given FromExpr[AsyncMacroFlags] with
def unapply(v: Expr[AsyncMacroFlags])(using Quotes): Option[AsyncMacroFlags] =
v match
case '{ AsyncMacroFlags(${Expr(printCode)},${Expr(printTree)},
${Expr(debugLevel)},
${Expr(allowShiftedLambda)},
${Expr(eMuted)},
${Expr(useLoomAwait)}
)
} =>
Some(AsyncMacroFlags(printCode, printTree,
debugLevel,
allowShiftedLambda,
eMuted,
useLoomAwait
))
case _ => None
end AsyncMacroFlags