Skip to content

Commit

Permalink
Removed most long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 24, 2025
1 parent d5dcaa0 commit 8573b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/core/contextual.Interpolator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ trait Interpolator[InputType, StateType, ResultType]:
erased given CanThrow[PositionalError] = unsafeExceptions.canThrowAny
given Diagnostics = Diagnostics.omit

throw PositionalError(msg, start + off.or(0), start + off.or(0) + len.or(end - start - off.or(0)))
throw PositionalError
(msg, start + off.or(0), start + off.or(0) + len.or(end - start - off.or(0)))

def recur
(seq: Seq[Expr[Any]],
Expand All @@ -75,7 +76,8 @@ trait Interpolator[InputType, StateType, ResultType]:
def notFound: Nothing =
val typeName: String = TypeRepr.of[headType].widen.show

halt(m"can't substitute ${Text(typeName)} into this interpolated string", head.asTerm.pos)
halt
(m"can't substitute ${Text(typeName)} into this interpolated string", head.asTerm.pos)

val (newState, typeclass) = Expr.summon[Insertion[InputType, headType]].fold(notFound): insertion =>
insertion.absolve match
Expand Down
3 changes: 2 additions & 1 deletion src/core/contextual.Verifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ extends Interpolator[Nothing, Optional[ResultType], ResultType]:
protected def insert(state: Optional[ResultType], value: Nothing): Optional[ResultType] = state
protected def complete(value: Optional[ResultType]): ResultType = value.option.get

def expand(context: Expr[StringContext])(using Quotes, Type[ResultType])(using thisType: Type[this.type])
def expand(context: Expr[StringContext])(using Quotes, Type[ResultType])
(using thisType: Type[this.type])
: Expr[ResultType] = expand(context, '{Nil})(using thisType)

0 comments on commit 8573b89

Please sign in to comment.