Skip to content

Commit

Permalink
fix scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Apr 25, 2024
1 parent 51ff2cd commit 523a2aa
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private [parsley] final class Named[A](_p: LazyParsley[A], val name: String) ext
XAssert.assert(!p.isInstanceOf[Named[_]], "Named parsers should not be nested within each other directly.")
def make(p: StrictParsley[A]): StrictParsley[A] = p
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visitUnknown(this, context)
override private [parsley] var debugName = name
private [parsley] var debugName = name
}

private [parsley] object Named {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private [parsley] final class TaggedWith[A](strat: DebugStrategy)(val origin: La
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visitUnknown(this, context)
// $COVERAGE-ON$

override private [parsley] var debugName = userAssignedName.getOrElse(origin.debugName)
private [parsley] var debugName = userAssignedName.getOrElse(origin.debugName)
}

private [parsley] object TaggedWith {
Expand Down Expand Up @@ -137,7 +137,7 @@ private [parsley] object TaggedWith {

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[B] = visitor.visitGeneric(this, context)

override private [parsley] var debugName = self.debugName
private [parsley] var debugName = self.debugName
}
}
}
Expand All @@ -151,7 +151,7 @@ private [parsley] object TaggedWith {

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visitGeneric(this, context)

override private [parsley] var debugName = self.debugName
private [parsley] var debugName = self.debugName
}
}
}
Expand All @@ -167,7 +167,7 @@ private [parsley] object TaggedWith {

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[D] = visitor.visitGeneric(this, context)

override private [parsley] var debugName = self.debugName
private [parsley] var debugName = self.debugName
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ private class DummyParser extends LazyParsley[Any] {
override protected def findLetsAux[M[_, +_] : ContOps, R](seen: Set[LazyParsley[_]])(implicit state: LetFinderState): M[R, Unit] = Utils.crash()
override protected def preprocess[M[_, +_] : ContOps, R, A_ >: Any](implicit lets: LetMap): M[R, StrictParsley[A_]] = Utils.crash()
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[Any] = visitor.visitUnknown(this, context)
override private [parsley] var debugName = "dummyParser"
private [parsley] var debugName = "dummyParser"
}

private class <**> extends LazyParsley[Any] {
override protected def findLetsAux[M[_, +_] : ContOps, R](seen: Set[LazyParsley[_]])(implicit state: LetFinderState): M[R, Unit] = Utils.crash()
override protected def preprocess[M[_, +_] : ContOps, R, A_ >: Any](implicit lets: LetMap): M[R, StrictParsley[A_]] = Utils.crash()
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[Any] = visitor.visitUnknown(this, context)
override private [parsley] var debugName = "<**>"
private [parsley] var debugName = "<**>"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private [parsley] final class ErrorLabel[A](p: LazyParsley[A], label: String, la
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, label, labels)

override private [parsley] var debugName = "label"
private [parsley] var debugName = "label"
// $COVERAGE-ON$
}
private [parsley] final class ErrorHide[A](p: LazyParsley[A]) extends Unary[A, A](p) {
Expand All @@ -22,7 +22,7 @@ private [parsley] final class ErrorHide[A](p: LazyParsley[A]) extends Unary[A, A
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p)

override private [parsley] var debugName: String = "errorHide"
private [parsley] var debugName: String = "errorHide"
// $COVERAGE-ON$
}
private [parsley] final class ErrorExplain[A](p: LazyParsley[A], reason: String) extends Unary[A, A](p) {
Expand All @@ -31,7 +31,7 @@ private [parsley] final class ErrorExplain[A](p: LazyParsley[A], reason: String)
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, reason)

override private [parsley] var debugName = "explain"
private [parsley] var debugName = "explain"
// $COVERAGE-ON$
}

Expand All @@ -41,7 +41,7 @@ private [parsley] final class ErrorAmend[A](p: LazyParsley[A], partial: Boolean)
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, partial)

override private [parsley] var debugName = "amend"
private [parsley] var debugName = "amend"
// $COVERAGE-ON$
}
private [parsley] final class ErrorEntrench[A](p: LazyParsley[A]) extends Unary[A, A](p) {
Expand All @@ -50,7 +50,7 @@ private [parsley] final class ErrorEntrench[A](p: LazyParsley[A]) extends Unary[
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p)

override private [parsley] var debugName = "entrench"
private [parsley] var debugName = "entrench"
// $COVERAGE-ON$
}
private [parsley] final class ErrorDislodge[A](n: Int, p: LazyParsley[A]) extends Unary[A, A](p) {
Expand All @@ -59,7 +59,7 @@ private [parsley] final class ErrorDislodge[A](n: Int, p: LazyParsley[A]) extend
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(n, p)

override private [parsley] var debugName = "dislodge"
private [parsley] var debugName = "dislodge"
// $COVERAGE-ON$
}

Expand All @@ -69,6 +69,6 @@ private [parsley] final class ErrorLexical[A](p: LazyParsley[A]) extends Unary[A
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p)

override private [parsley] var debugName = "markAsToken"
private [parsley] var debugName = "markAsToken"
// $COVERAGE-ON$
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private [parsley] final class Lift2[A, B, C](private val f: (A, B) => C, p: Lazy
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visit(this, context)(f, p, q)

override private [parsley] var debugName = "lift.lift2"
private [parsley] var debugName = "lift.lift2"
// $COVERAGE-ON$
}
private [parsley] final class Lift3[A, B, C, D](private val f: (A, B, C) => D, p: LazyParsley[A], q: =>LazyParsley[B], r: =>LazyParsley[C])
Expand All @@ -25,7 +25,7 @@ private [parsley] final class Lift3[A, B, C, D](private val f: (A, B, C) => D, p
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[D] = visitor.visit(this, context)(f, p, q, r)

override private [parsley] var debugName = "lift.lift3"
private [parsley] var debugName = "lift.lift3"
// $COVERAGE-ON$
}
private [parsley] final class Local[S, A](val ref: Ref[S], p: LazyParsley[S], q: =>LazyParsley[A]) extends Binary[S, A, A](p, q) with UsesRef {
Expand All @@ -34,6 +34,6 @@ private [parsley] final class Local[S, A](val ref: Ref[S], p: LazyParsley[S], q:
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(ref, p, q)

override private [parsley] var debugName = "local"
private [parsley] var debugName = "local"
// $COVERAGE-ON$
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private [parsley] final class Many[A, C](p: LazyParsley[A], factory: Factory[A,
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visit(this, context)(p, factory)

override private [parsley] var debugName = "many"
private [parsley] var debugName = "many"
// $COVERAGE-ON$
}
private [parsley] final class ChainPost[A](p: LazyParsley[A], _op: =>LazyParsley[A => A]) extends Binary[A, A => A, A](p, _op) {
Expand All @@ -25,7 +25,7 @@ private [parsley] final class ChainPost[A](p: LazyParsley[A], _op: =>LazyParsley
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, _op)

override private [parsley] var debugName = "chain.postfix"
private [parsley] var debugName = "chain.postfix"
// $COVERAGE-ON$
}
private [parsley] final class ChainPre[A](p: LazyParsley[A], op: LazyParsley[A => A]) extends LazyParsley[A] {
Expand All @@ -41,7 +41,7 @@ private [parsley] final class ChainPre[A](p: LazyParsley[A], op: LazyParsley[A =
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, op)

override private [parsley] var debugName = "chain.prefix"
private [parsley] var debugName = "chain.prefix"
// $COVERAGE-ON$
}
private [parsley] final class Chainl[A, B](init: LazyParsley[B], p: =>LazyParsley[A], op: =>LazyParsley[(B, A) => B], var debugName: String)
Expand All @@ -59,7 +59,7 @@ private [parsley] final class Chainr[A, B](p: LazyParsley[A], op: =>LazyParsley[
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[B] = visitor.visit(this, context)(p, op, wrap)

override private [parsley] var debugName = "infix.right1"
private [parsley] var debugName = "infix.right1"
// $COVERAGE-ON$
}
private [parsley] final class SepEndBy1[A, C](p: LazyParsley[A], sep: =>LazyParsley[_], factory: Factory[A, C]) extends Binary[A, Any, C](p, sep) {
Expand All @@ -68,7 +68,7 @@ private [parsley] final class SepEndBy1[A, C](p: LazyParsley[A], sep: =>LazyPars
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visit(this, context)(p, sep, factory)

override private [parsley] var debugName = "sepEndBy1"
private [parsley] var debugName = "sepEndBy1"
// $COVERAGE-ON$
}
private [parsley] final class ManyUntil[A, C](body: LazyParsley[Any], factory: Factory[A, C]) extends Unary[Any, C](body) {
Expand All @@ -77,7 +77,7 @@ private [parsley] final class ManyUntil[A, C](body: LazyParsley[Any], factory: F
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visit(this, context)(body, factory)

override private [parsley] var debugName = "manyUntil"
private [parsley] var debugName = "manyUntil"
// $COVERAGE-ON$
}
private [parsley] final class SkipManyUntil(body: LazyParsley[Any]) extends Unary[Any, Unit](body) {
Expand All @@ -86,6 +86,6 @@ private [parsley] final class SkipManyUntil(body: LazyParsley[Any]) extends Unar
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[Unit] = visitor.visit(this, context)(body)

override private [parsley] var debugName = "skipManyUntil"
private [parsley] var debugName = "skipManyUntil"
// $COVERAGE-ON$
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private [parsley] final class Attempt[A](p: LazyParsley[A]) extends Unary[A, A](
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p)

override private [parsley] var debugName = "atomic"
private [parsley] var debugName = "atomic"
// $COVERAGE-ON$
}
private [parsley] final class Look[A](p: LazyParsley[A]) extends Unary[A, A](p) {
Expand All @@ -26,7 +26,7 @@ private [parsley] final class Look[A](p: LazyParsley[A]) extends Unary[A, A](p)
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p)

override private [parsley] var debugName = "lookAhead"
private [parsley] var debugName = "lookAhead"
// $COVERAGE-ON$
}
private [parsley] final class NotFollowedBy[A](p: LazyParsley[A]) extends Unary[A, Unit](p) {
Expand All @@ -35,7 +35,7 @@ private [parsley] final class NotFollowedBy[A](p: LazyParsley[A]) extends Unary[
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[Unit] = visitor.visit(this, context)(p)

override private [parsley] var debugName = "notFollowedBy"
private [parsley] var debugName = "notFollowedBy"
// $COVERAGE-ON$
}
private [parsley] final class Put[S](val ref: Ref[S], _p: LazyParsley[S]) extends Unary[S, Unit](_p) with UsesRef {
Expand All @@ -44,7 +44,7 @@ private [parsley] final class Put[S](val ref: Ref[S], _p: LazyParsley[S]) extend
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[Unit] = visitor.visit(this, context)(ref, _p)

override private [parsley] var debugName = "Ref.set"
private [parsley] var debugName = "Ref.set"
// $COVERAGE-ON$
}
private [parsley] final class NewReg[S, A](val ref: Ref[S], init: LazyParsley[S], body: =>LazyParsley[A]) extends Binary[S, A, A](init, body) with UsesRef {
Expand All @@ -53,7 +53,7 @@ private [parsley] final class NewReg[S, A](val ref: Ref[S], init: LazyParsley[S]
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(ref, init, body)

override private [parsley] var debugName = "fillRef"
private [parsley] var debugName = "fillRef"
// $COVERAGE-ON$
}
private [parsley] final class Span(p: LazyParsley[_]) extends Unary[Any, String](p) {
Expand All @@ -62,7 +62,7 @@ private [parsley] final class Span(p: LazyParsley[_]) extends Unary[Any, String]
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[String] = visitor.visit(this, context)(p)

override private [parsley] var debugName: String = "span"
private [parsley] var debugName: String = "span"
// $COVERAGE-ON$
}

Expand All @@ -73,29 +73,29 @@ private [parsley] final class Debug[A](p: LazyParsley[A], name: String, ascii: B

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, name, ascii, break, watchedRefs)

override private [parsley] var debugName = "debug"
private [parsley] var debugName = "debug"
}
private [parsley] final class DebugError[A](p: LazyParsley[A], name: String, ascii: Boolean, errBuilder: ErrorBuilder[_]) extends Unary[A, A](p) {
override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.DebugError(p, name, ascii, errBuilder)

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, name, ascii, errBuilder)

override private [parsley] var debugName = "debugError"
private [parsley] var debugName = "debugError"
}

private [parsley] final class Profile[A](p: LazyParsley[A], name: String, profiler: Profiler) extends Unary[A, A](p) {
override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Profile(p, name, profiler)

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, name, profiler)

override private [parsley] var debugName: String = "profile"
private [parsley] var debugName: String = "profile"
}

private [parsley] final class Opaque[A](p: LazyParsley[A]) extends Unary[A, A](p) {
override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Opaque(p)

override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = p.visit(visitor, context)

override private [parsley] var debugName: String = "impure"
private [parsley] var debugName: String = "impure"
}
// $COVERAGE-ON$
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private [parsley] final class Branch[A, B, C](b: LazyParsley[Either[A, B]], p: =
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[C] = visitor.visit(this, context)(b, p, q)

override private [parsley] var debugName = "branch"
private [parsley] var debugName = "branch"
// $COVERAGE-ON$
}

Expand All @@ -24,7 +24,7 @@ private [parsley] final class If[A](b: LazyParsley[Boolean], p: =>LazyParsley[A]
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(b, p, q)

override private [parsley] var debugName = "ifP"
private [parsley] var debugName = "ifP"
// $COVERAGE-ON$
}

Expand All @@ -35,7 +35,7 @@ private [parsley] final class Filter[A](p: LazyParsley[A], pred: A => Boolean, e
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, pred, err)

override private [parsley] var debugName = "filter"
private [parsley] var debugName = "filter"
// $COVERAGE-ON$
}

Expand All @@ -46,6 +46,6 @@ private [parsley] final class MapFilter[A, B](p: LazyParsley[A], pred: A => Opti
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[B] = visitor.visit(this, context)(p, pred, err)

override private [parsley] var debugName: String = "mapFilter"
private [parsley] var debugName: String = "mapFilter"
// $COVERAGE-ON$
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private [parsley] final class <*>[A, B](pf: LazyParsley[A => B], px: =>LazyParsl
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[B] = visitor.visit(this, context)(pf, px)

override private [parsley] var debugName = "<*>"
private [parsley] var debugName = "<*>"
// $COVERAGE-ON$
}

Expand All @@ -23,7 +23,7 @@ private [parsley] final class >>=[A, B](p: LazyParsley[A], private val f: A => L
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[B] = visitor.visit(this, context)(p, f)

override private [parsley] var debugName = "flatMap"
private [parsley] var debugName = "flatMap"
// $COVERAGE-ON$
}

Expand All @@ -33,7 +33,7 @@ private [parsley] final class *>[A](_p: LazyParsley[_], _q: =>LazyParsley[A]) ex
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(_p, _q)

override private [parsley] var debugName = "~>"
private [parsley] var debugName = "~>"
// $COVERAGE-ON$
}
private [parsley] final class <*[A](_p: LazyParsley[A], _q: =>LazyParsley[_]) extends Binary[A, Any, A](_p, _q) {
Expand All @@ -42,6 +42,6 @@ private [parsley] final class <*[A](_p: LazyParsley[A], _q: =>LazyParsley[_]) ex
// $COVERAGE-OFF$
override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(_p, _q)

override private [parsley] var debugName = "<~"
private [parsley] var debugName = "<~"
// $COVERAGE-ON$
}
Loading

0 comments on commit 523a2aa

Please sign in to comment.