Skip to content

Commit

Permalink
Policy: restore implicit FileLine in Clause
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Dec 21, 2024
1 parent 932189d commit 5dc2a85
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,30 @@ object Policy {
prefix: String,
noDequeue: Boolean = false,
rank: Int = 0,
)(f: Pf): Policy = apply(prefix, noDequeue, rank)(f) < exp
)(f: Pf)(implicit fl: FileLine): Policy = apply(prefix, noDequeue, rank)(f) <
exp

def onLeft(exp: FT, prefix: String, noDequeue: Boolean = false, rank: Int = 0)(
f: Pf,
): Policy = apply(prefix, noDequeue, rank = rank)(f) <= exp
)(implicit fl: FileLine): Policy = apply(prefix, noDequeue, rank = rank)(f) <=
exp

def onRight(exp: FT, prefix: String, noDequeue: Boolean = false, rank: Int = 0)(
f: Pf,
): Policy = apply(prefix, noDequeue, rank = rank)(f) >= exp
)(implicit fl: FileLine): Policy = apply(prefix, noDequeue, rank = rank)(f) >=
exp

def afterRight(
exp: FT,
prefix: String,
noDequeue: Boolean = false,
rank: Int = 0,
)(f: Pf): Policy = apply(prefix, noDequeue, rank)(f) > exp
)(f: Pf)(implicit fl: FileLine): Policy = apply(prefix, noDequeue, rank)(f) >
exp

def onlyFor(on: FT, prefix: String, noDequeue: Boolean = false, rank: Int = 0)(
f: Seq[Split] => Seq[Split],
): Policy = End <= on ==>
)(implicit fl: FileLine): Policy = End <= on ==>
onRight(on, s"$prefix[${on.idx}]", noDequeue, rank) {
case Decision(`on`, ss) => f(ss)
}
Expand Down Expand Up @@ -415,7 +419,7 @@ object Policy {
val noDequeue: Boolean = false,
val rank: Int = 0,
desc: => String = "",
)(pred: Split => Split)
)(pred: Split => Split)(implicit fl: FileLine)
extends Clause {
private object PredicateDecision {
def unapply(d: Decision): Option[Seq[Split]] = {
Expand Down

0 comments on commit 5dc2a85

Please sign in to comment.