Skip to content

Commit

Permalink
Whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Dec 14, 2024
1 parent 1d68421 commit 7ed5bca
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/core/adversaria.Adversaria.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ object Adversaria:
fields.flatMap: field =>
field.annotations.map(_.asExpr).collect:
case '{$annotation: AnnotationType} => annotation
.map: annotation =>
'{CaseField(Text(${Expr(field.name)}), (target: TargetType) =>
${'target.asTerm.select(field).asExpr}, $annotation)}
.reverse
.head

. map: annotation =>
'{CaseField(Text(${Expr(field.name)}), (target: TargetType) =>
${'target.asTerm.select(field).asExpr}, $annotation)}
. reverse
. head

def fields[TargetType <: Product: Type, AnnotationType <: StaticAnnotation: Type](using Quotes)
: Expr[List[CaseField[TargetType, AnnotationType]]] =
Expand All @@ -54,10 +55,12 @@ object Adversaria:
val name = Expr(field.name)
field.annotations.map(_.asExpr).collect:
case '{$annotation: AnnotationType} => annotation
.map: annotation =>
'{CaseField(Text($name), (target: TargetType) => ${'target.asTerm.select(field).asExpr},
$annotation)}
.reverse

. map: annotation =>
'{CaseField(Text($name), (target: TargetType) => ${'target.asTerm.select(field).asExpr},
$annotation)}

. reverse

Expr.ofList(elements)

Expand Down

0 comments on commit 7ed5bca

Please sign in to comment.