diff --git a/parsley/shared/src/main/scala/parsley/Parsley.scala b/parsley/shared/src/main/scala/parsley/Parsley.scala index 286c18ed2..1e87758b5 100644 --- a/parsley/shared/src/main/scala/parsley/Parsley.scala +++ b/parsley/shared/src/main/scala/parsley/Parsley.scala @@ -180,7 +180,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @note just an alias for `as`. * @group map */ - def #>[B](x: B): Parsley[B] = this.as(x) + def #>[B](x: B): Parsley[B] = this.as(x).uo("#>") /** This combinator replaces the result of this parser, ignoring the old result. * * Similar to `map`, except the old result of this parser is not required to @@ -199,7 +199,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @return a new parser that behaves the same as this parser, but always succeeds with `x` as the result. * @group map */ - def as[B](x: B): Parsley[B] = this *> pure(x) + def as[B](x: B): Parsley[B] = this.rseq(pure(x), "as") /** Replaces the result of this parser with `()`. * * This combinator is useful when the result of this parser is not required, and the @@ -234,6 +234,8 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front */ def <|>[Aʹ >: A](q: Parsley[Aʹ]): Parsley[Aʹ] = this.alt(q, "<|>") @inline private def alt[Aʹ >: A](q: Parsley[Aʹ], name: String): Parsley[Aʹ] = new Parsley(new frontend.<|>(this.internal, q.internal, name)) + // transparent right-associative alt combinator + private [parsley] def |:[Aʹ >: A](q: Parsley[Aʹ]): Parsley[Aʹ] = q.alt(this, null) /** This combinator, pronounced "or", $or * * $attemptreason @@ -362,6 +364,12 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front */ def <*>[B, C](px: =>Parsley[B]) (implicit ev: A <:< (B=>C)): Parsley[C] = new Parsley(new frontend.<*>[B, C](ev.substituteParsley(this).internal, px.internal)) + + // transparent version of <*> + private [parsley] def ap[B, C](px: =>Parsley[B])(implicit ev: A <:< (B=>C)): Parsley[C] = { + new Parsley(new frontend.<*>[B, C](ev.substituteParsley(this).internal, px.internal)).ut() // FIXME: move into node + } + /** This combinator, pronounced "reverse ap", first parses this parser then parses `pf`: if both succeed then the value * returned by this parser is applied to the function returned by `pf`. * @@ -386,7 +394,12 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @note equivalent to {{{lift2((x, f) => f(x), this, pf)}}} * @group seq */ - def <**>[B](pf: =>Parsley[A => B]): Parsley[B] = lift.lift2[A, A=>B, B]((x, f) => f(x), this, pf) + def <**>[B](pf: =>Parsley[A => B]): Parsley[B] = lift.lift2[A, A=>B, B]((x, f) => f(x), this, pf).uo("<**>") + + // FIXME: move into nodes + @inline private def lseq[B](q: =>Parsley[B], name: String): Parsley[A] = new Parsley(new frontend.<*(this.internal, q.internal)).uo(name) + @inline private def rseq[B](q: =>Parsley[B], name: String): Parsley[B] = new Parsley(new frontend.*>(this.internal, q.internal)).uo(name) + /** This combinator, pronounced "then", first parses this parser then parses `q`: if both succeed then the result * of `q` is returned. * @@ -405,7 +418,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @return a parser that sequences this parser with `q` and returns `q`'s result. * @group seq */ - def *>[B](q: =>Parsley[B]): Parsley[B] = new Parsley(new frontend.*>(this.internal, q.internal)) + def *>[B](q: =>Parsley[B]): Parsley[B] = this.rseq(q, "*>") /** This combinator, pronounced "then discard", first parses this parser then parses `q`: if both succeed then the result * of this parser is returned. * @@ -424,7 +437,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @return a parser that sequences this parser with `q` and returns this parser's result. * @group seq */ - def <*[B](q: =>Parsley[B]): Parsley[A] = new Parsley(new frontend.<*(this.internal, q.internal)) + def <*[B](q: =>Parsley[B]): Parsley[A] = this.lseq(q, "<*") /** This combinator, pronounced "then", first parses this parser then parses `q`: if both succeed then the result * of `q` is returned. * @@ -444,7 +457,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @since 2.4.0 * @group seq */ - def ~>[B](q: =>Parsley[B]): Parsley[B] = this *> q + def ~>[B](q: =>Parsley[B]): Parsley[B] = this.rseq(q, "~>") /** This combinator, pronounced "then discard", first parses this parser then parses `q`: if both succeed then the result * of this parser is returned. * @@ -464,7 +477,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @since 2.4.0 * @group seq */ - def <~[B](q: =>Parsley[B]): Parsley[A] = this <* q + def <~[B](q: =>Parsley[B]): Parsley[A] = this.lseq(q, "<~") /** This combinator, pronounced "prepend", first parses this parser then parses `ps`: if both succeed the result of this * parser is prepended onto the result of `ps`. * @@ -484,7 +497,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @note equivalent to {{{lift2(_ +: _, this, ps)}}} * @group seq */ - def <+:>[Aʹ >: A](ps: =>Parsley[Seq[Aʹ]]): Parsley[Seq[Aʹ]] = lift.lift2[A, Seq[Aʹ], Seq[Aʹ]](_ +: _, this, ps) + def <+:>[Aʹ >: A](ps: =>Parsley[Seq[Aʹ]]): Parsley[Seq[Aʹ]] = lift.lift2[A, Seq[Aʹ], Seq[Aʹ]](_ +: _, this, ps).uo("<+:>") /** This combinator, pronounced "cons", first parses this parser then parses `ps`: if both succeed the result of this * parser is prepended onto the result of `ps`. * @@ -504,7 +517,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @note equivalent to {{{lift2(_ :: _, this, ps)}}} * @group seq */ - def <::>[Aʹ >: A](ps: =>Parsley[List[Aʹ]]): Parsley[List[Aʹ]] = lift.lift2[A, List[Aʹ], List[Aʹ]](_ :: _, this, ps) + def <::>[Aʹ >: A](ps: =>Parsley[List[Aʹ]]): Parsley[List[Aʹ]] = lift.lift2[A, List[Aʹ], List[Aʹ]](_ :: _, this, ps).uo("<::>") /** This combinator, pronounced "zip", first parses this parser then parses `q`: if both succeed the result of this * parser is paired with the result of `q`. * @@ -527,7 +540,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @note equivalent to {{{lift2((_, _), this, q)}}} * @group seq */ - def <~>[B](q: =>Parsley[B]): Parsley[(A, B)] = lift.lift2[A, B, (A, B)]((_, _), this, q) + def <~>[B](q: =>Parsley[B]): Parsley[(A, B)] = lift.lift2[A, B, (A, B)]((_, _), this, q).uo("<~>") /** This combinator first parses this parser then parses `q`: if both succeed the result of this * parser is paired with the result of `q`. * @@ -551,7 +564,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * @since 2.3.0 * @group seq */ - def zip[B](q: =>Parsley[B]): Parsley[(A, B)] = this <~> q + def zip[B](q: =>Parsley[B]): Parsley[(A, B)] = lift.lift2[A, B, (A, B)]((_, _), this, q).uo("zip") // FILTERING COMBINATORS /** This combinator filters the result of this parser using a given predicate, succeeding only if the predicate returns `true`. @@ -911,7 +924,7 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front * the optimiser cannot see that the result of a parser is mutating some value, and may remove it. * @group special */ - def impure: Parsley[A] = new Parsley(new frontend.Opaque(this.internal)) + def impure: Parsley[A] = new Parsley(new frontend.Impure(this.internal)) /** This is an alias for `p.filter(pred)`. It is needed to support for-comprehension syntax with `if`s. * @@ -1028,7 +1041,7 @@ object Parsley extends ParsleyImpl with PlatformSpecific { * @return the parser `p`, but guaranteed to be lazy. * @group special */ - def unary_~ : Parsley[A] = unit *> p + def unary_~ : Parsley[A] = (transPure(()) *> p).ut() // I don't think this needs to appear in debug trace } } private [parsley] abstract class ParsleyImpl { @@ -1156,7 +1169,7 @@ private [parsley] abstract class ParsleyImpl { * @since 4.4.0 * @group prim */ - final def atomic[A](p: Parsley[A]): Parsley[A] = new Parsley(new frontend.Attempt(p.internal)) + final def atomic[A](p: Parsley[A]): Parsley[A] = new Parsley(new frontend.Atomic(p.internal)) /** This combinator parses its argument `p`, but does not consume input if it succeeds. * * If the parser `p` succeeds, then `lookAhead(p)` will roll back any input consumed diff --git a/parsley/shared/src/main/scala/parsley/ap.scala b/parsley/shared/src/main/scala/parsley/ap.scala index fe0c676b0..5150893e7 100644 --- a/parsley/shared/src/main/scala/parsley/ap.scala +++ b/parsley/shared/src/main/scala/parsley/ap.scala @@ -5,7 +5,6 @@ */ package parsley -//TODO: opaque/transparent /** This module contains `ap1` through `ap22`, which allow for the application of a parser returning a function of arity `N` to `N` parsers. * * The combinators contained in this module all sequence a number of parsers together, but are capable of combining the @@ -52,7 +51,7 @@ private [parsley] trait ap { final def ap1[T1, R] (pf: Parsley[T1 => R], p1: =>Parsley[T1]): Parsley[R] = - pf <*> p1 + (pf ap p1).uo("ap1") /** $bodyAp * * @param pf $paramAp two. @@ -62,7 +61,7 @@ private [parsley] trait ap { final def ap2[T1, T2, R] (pf: Parsley[(T1, T2) => R], p1: =>Parsley[T1], p2: =>Parsley[T2]): Parsley[R] = - pf.map(_.curried) <*> p1 <*> p2 + (pf.map(_.curried).ut() ap p1 ap p2).uo("ap2") /** $bodyAp * * @param pf $paramAp three. @@ -72,7 +71,7 @@ private [parsley] trait ap { final def ap3[T1, T2, T3, R] (pf: Parsley[(T1, T2, T3) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3]): Parsley[R] = - pf.map(_.curried) <*> p1 <*> p2 <*> p3 + (pf.map(_.curried).ut() ap p1 ap p2 ap p3).uo("ap3") // $COVERAGE-ON$ // $COVERAGE-OFF$ /** $bodyAp @@ -83,7 +82,7 @@ private [parsley] trait ap { final def ap4[T1, T2, T3, T4, R] (pf: Parsley[(T1, T2, T3, T4) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4]): Parsley[R] = - _ap4(pf.map(_.curried), p1, p2, p3, p4) + _ap4(pf.map(_.curried).ut(), p1, p2, p3, p4).uo("ap4") /** $bodyAp * * @param pf $paramAp five. @@ -92,7 +91,7 @@ private [parsley] trait ap { final def ap5[T1, T2, T3, T4, T5, R] (pf: Parsley[(T1, T2, T3, T4, T5) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5]): Parsley[R] = - _ap5(pf.map(_.curried), p1, p2, p3, p4, p5) + _ap5(pf.map(_.curried).ut(), p1, p2, p3, p4, p5).uo("ap5") /** $bodyAp * * @param pf $paramAp six. @@ -101,7 +100,7 @@ private [parsley] trait ap { final def ap6[T1, T2, T3, T4, T5, T6, R] (pf: Parsley[(T1, T2, T3, T4, T5, T6) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6]): Parsley[R] = - _ap6(pf.map(_.curried), p1, p2, p3, p4, p5, p6) + _ap6(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6).uo("ap6") /** $bodyAp * * @param pf $paramAp seven. @@ -110,7 +109,7 @@ private [parsley] trait ap { final def ap7[T1, T2, T3, T4, T5, T6, T7, R] (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7]): Parsley[R] = - _ap7(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7) + _ap7(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7).uo("ap7") /** $bodyAp * * @param pf $paramAp eight. @@ -120,7 +119,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8]): Parsley[R] = - _ap8(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8) + _ap8(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8).uo("ap8") /** $bodyAp * * @param pf $paramAp nine. @@ -130,7 +129,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9]): Parsley[R] = - _ap9(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9) + _ap9(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9).uo("ap9") /** $bodyAp * * @param pf $paramAp ten. @@ -140,7 +139,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10]): Parsley[R] = - _ap10(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) + _ap10(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10).uo("ap10") /** $bodyAp * * @param pf $paramAp eleven. @@ -150,7 +149,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11]): Parsley[R] = - _ap11(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) + _ap11(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11).uo("ap11") /** $bodyAp * * @param pf $paramAp twelve. @@ -160,7 +159,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12]): Parsley[R] = - _ap12(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) + _ap12(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12).uo("ap12") /** $bodyAp * * @param pf $paramAp thirteen. @@ -170,7 +169,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13]): Parsley[R] = - _ap13(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) + _ap13(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13).uo("ap13") /** $bodyAp * * @param pf $paramAp fourteen. @@ -180,7 +179,7 @@ private [parsley] trait ap { (pf: Parsley[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14]): Parsley[R] = - _ap14(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) + _ap14(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14).uo("ap14") /** $bodyAp * * @param pf $paramAp fifteen. @@ -191,7 +190,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15]): Parsley[R] = - _ap15(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) + _ap15(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15).uo("ap15") /** $bodyAp * * @param pf $paramAp sixteen. @@ -202,7 +201,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16]): Parsley[R] = - _ap16(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) + _ap16(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16).uo("ap16") /** $bodyAp * * @param pf $paramAp seventeen. @@ -213,7 +212,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17]): Parsley[R] = - _ap17(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) + _ap17(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17).uo("ap17") /** $bodyAp * * @param pf $paramAp eighteen. @@ -224,7 +223,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18]): Parsley[R] = - _ap18(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) + _ap18(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18).uo("ap18") /** $bodyAp * * @param pf $paramAp nineteen. @@ -235,7 +234,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19]): Parsley[R] = - _ap19(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) + _ap19(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19).uo("ap19") /** $bodyAp * * @param pf $paramAp twenty. @@ -246,7 +245,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20]): Parsley[R] = - _ap20(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) + _ap20(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20).uo("ap20") /** $bodyAp * * @param pf $paramAp twenty-one. @@ -257,7 +256,7 @@ private [parsley] trait ap { p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21]): Parsley[R] = - _ap21(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) + _ap21(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21).uo("ap21") // $COVERAGE-ON$ /** $bodyAp * @@ -270,102 +269,102 @@ private [parsley] trait ap { p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21], p22: =>Parsley[T22]): Parsley[R] = - _ap22(pf.map(_.curried), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22) + _ap22(pf.map(_.curried).ut(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22).uo("ap22") // INTERNAL HELPERS @inline private final def _ap4[T1, T2, T3, T4, R] (pf: Parsley[T1 => T2 => T3 => T4 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4]): Parsley[R] = - pf <*> p1 <*> p2 <*> p3 <*> p4 + pf ap p1 ap p2 ap p3 ap p4 @inline private final def _ap5[T1, T2, T3, T4, T5, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5]): Parsley[R] = - _ap4(pf, p1, p2, p3, p4) <*> p5 + _ap4(pf, p1, p2, p3, p4) ap p5 @inline private final def _ap6[T1, T2, T3, T4, T5, T6, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6]): Parsley[R] = - _ap5(pf, p1, p2, p3, p4, p5) <*> p6 + _ap5(pf, p1, p2, p3, p4, p5) ap p6 @inline private final def _ap7[T1, T2, T3, T4, T5, T6, T7, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7]): Parsley[R] = - _ap6(pf, p1, p2, p3, p4, p5, p6) <*> p7 + _ap6(pf, p1, p2, p3, p4, p5, p6) ap p7 @inline private final def _ap8[T1, T2, T3, T4, T5, T6, T7, T8, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8]): Parsley[R] = - _ap7(pf, p1, p2, p3, p4, p5, p6, p7) <*> p8 + _ap7(pf, p1, p2, p3, p4, p5, p6, p7) ap p8 @inline private final def _ap9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9]): Parsley[R] = - _ap8(pf, p1, p2, p3, p4, p5, p6, p7, p8) <*> p9 + _ap8(pf, p1, p2, p3, p4, p5, p6, p7, p8) ap p9 @inline private final def _ap10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10]): Parsley[R] = - _ap9(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9) <*> p10 + _ap9(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9) ap p10 @inline private final def _ap11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11]): Parsley[R] = - _ap10(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) <*> p11 + _ap10(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) ap p11 @inline private final def _ap12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12]): Parsley[R] = - _ap11(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) <*> p12 + _ap11(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) ap p12 @inline private final def _ap13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13]): Parsley[R] = - _ap12(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) <*> p13 + _ap12(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) ap p13 @inline private final def _ap14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14]): Parsley[R] = - _ap13(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) <*> p14 + _ap13(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) ap p14 @inline private final def _ap15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15]): Parsley[R] = - _ap14(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) <*> p15 + _ap14(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) ap p15 @inline private final def _ap16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16]): Parsley[R] = - _ap15(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) <*> p16 + _ap15(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) ap p16 @inline private final def _ap17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17]): Parsley[R] = - _ap16(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) <*> p17 + _ap16(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) ap p17 @inline private final def _ap18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18]): Parsley[R] = - _ap17(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) <*> p18 + _ap17(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) ap p18 @inline private final def _ap19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19]): Parsley[R] = - _ap18(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) <*> p19 + _ap18(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) ap p19 @inline private final def _ap20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20]): Parsley[R] = - _ap19(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) <*> p20 + _ap19(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) ap p20 @inline private final def _ap21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => R], p1: =>Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21]): Parsley[R] = - _ap20(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) <*> p21 + _ap20(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) ap p21 @inline private final def _ap22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] (pf: Parsley[T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => T22 => R], @@ -373,6 +372,6 @@ private [parsley] trait ap { p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21], p22: =>Parsley[T22]): Parsley[R] = - _ap21(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) <*> p22 + _ap21(pf, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) ap p22 // scalastyle:on parameter.number ensure.single.space.after.token } diff --git a/parsley/shared/src/main/scala/parsley/combinator.scala b/parsley/shared/src/main/scala/parsley/combinator.scala index 7525aab4e..758185bdf 100644 --- a/parsley/shared/src/main/scala/parsley/combinator.scala +++ b/parsley/shared/src/main/scala/parsley/combinator.scala @@ -99,11 +99,11 @@ private [parsley] trait combinator { * @group multi * @see [[parsley.Parsley.<|> `<|>`]] */ - final def choice[A](ps: Parsley[A]*): Parsley[A] = ps.reduceRightOption(_ <|> _).getOrElse(empty) + final def choice[A](ps: Parsley[A]*): Parsley[A] = ps.reduceRightOption(_ |: _).getOrElse(empty(0)).uo("choice") // This combinator is still used in internal testing, but is a trap for new users // it will not be exposed in the API again. - private [parsley] final def atomicChoice[A](ps: Parsley[A]*): Parsley[A] = ps.reduceRightOption((p, q) => atomic(p) <|> q).getOrElse(empty) + private [parsley] final def atomicChoice[A](ps: Parsley[A]*): Parsley[A] = choice(ps.map(atomic(_)): _*) /** This combinator will parse each of `ps` in order, collecting the results. * diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/AlternativeEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/AlternativeEmbedding.scala index 26c54925e..2addd44b7 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/AlternativeEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/AlternativeEmbedding.scala @@ -139,7 +139,7 @@ private [backend] object Choice { } else alt2 match { case Pure(x) => alt1 match { - case Attempt(u) => scopedState(u, producesResults) { + case Atomic(u) => scopedState(u, producesResults) { instrs += new instructions.AlwaysRecoverWith[A](x) if (!producesResults) instrs += instructions.Pop result(()) @@ -159,7 +159,7 @@ private [backend] object Choice { (implicit instrs: InstrBuffer, state: CodeGenState): M[R, Unit] = { val merge = state.getLabel(instructions.MergeErrorsAndFail) p match { - case Attempt(u) => scopedState(u, producesResults) { + case Atomic(u) => scopedState(u, producesResults) { instrs += new instructions.RestoreAndPushHandler(merge) rest |> { instrs += instructions.ErrorToHints @@ -237,7 +237,7 @@ private [backend] object Choice { // TODO: This can be done for case insensitive things too, but with duplicated branching case t@token.SoftKeyword(s) if t.caseSensitive => Some((s.head, t.expected.asExpectDescs(s), s.codePointCount(0, s.length), backtracks)) case t@token.SoftOperator(s) => Some((s.head, t.expected.asExpectDescs(s), s.codePointCount(0, s.length), backtracks)) - case Attempt(t) => tablable(t, backtracks = true) + case Atomic(t) => tablable(t, backtracks = true) case ErrorLabel(t, label, labels) => tablable(t, backtracks).map { case (c, _, width, backtracks) => (c, (label +: labels).map(new ExpectDesc(_)), width, backtracks) } diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/PrimitiveEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/PrimitiveEmbedding.scala index dfc70b9e3..738cdc619 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/PrimitiveEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/PrimitiveEmbedding.scala @@ -16,13 +16,13 @@ import parsley.internal.machine.instructions import StrictParsley.InstrBuffer import org.typelevel.scalaccompat.annotation.nowarn3 -private [deepembedding] final class Attempt[A](val p: StrictParsley[A]) extends ScopedUnaryWithState[A, A] { +private [deepembedding] final class Atomic[A](val p: StrictParsley[A]) extends ScopedUnaryWithState[A, A] { override val instr: instructions.Instr = instructions.PopHandlerAndState override def instrNeedsLabel: Boolean = false override def handlerLabel(state: CodeGenState): Int = state.getLabel(instructions.RestoreAndFail) override def optimise: StrictParsley[A] = p match { case p: CharTok[_] => p - case p: Attempt[_] => p + case p: Atomic[_] => p //case StringTok(s, _) if s.size == 1 => p case _ => this } @@ -64,7 +64,7 @@ private [deepembedding] final class Let[A] extends StrictParsley[A] { def pretty: String = this.toString // $COVERAGE-ON$ } -private [deepembedding] final class Opaque[A](p: StrictParsley[A]) extends StrictParsley[A] { +private [deepembedding] final class Impure[A](p: StrictParsley[A]) extends StrictParsley[A] { def inlinable: Boolean = p.inlinable override def codeGen[M[_, +_]: ContOps, R](producesResults: Boolean)(implicit instrs: InstrBuffer, state: CodeGenState): M[R,Unit] = { // this blocks result suppression, because the ErrorGen combinators have non-inspectible control flow @@ -172,6 +172,6 @@ private [backend] object Profile { } // $COVERAGE-ON$ -private [backend] object Attempt { - def unapply[A](self: Attempt[A]): Some[StrictParsley[A]] = Some(self.p) +private [backend] object Atomic { + def unapply[A](self: Atomic[A]): Some[StrictParsley[A]] = Some(self.p) } diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/ErrorEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/ErrorEmbedding.scala index 3fc94f994..1f399e481 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/ErrorEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/ErrorEmbedding.scala @@ -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) - private [parsley] var debugName: String = "errorHide" + private [parsley] var debugName: String = "hide" // $COVERAGE-ON$ } private [parsley] final class ErrorExplain[A](p: LazyParsley[A], reason: String) extends Unary[A, A](p) { @@ -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) - private [parsley] var debugName = "markAsToken" + private [parsley] var debugName = null // I don't think this is useful to see in the debug output // $COVERAGE-ON$ } diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/PrimitiveEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/PrimitiveEmbedding.scala index 04675124c..883a4150a 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/PrimitiveEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/PrimitiveEmbedding.scala @@ -11,8 +11,8 @@ import parsley.state.Ref import parsley.internal.deepembedding.backend, backend.StrictParsley -private [parsley] final class Attempt[A](p: LazyParsley[A]) extends Unary[A, A](p) { - override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Attempt(p) +private [parsley] final class Atomic[A](p: LazyParsley[A]) extends Unary[A, A](p) { + override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Atomic(p) // $COVERAGE-OFF$ override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p) @@ -91,8 +91,8 @@ private [parsley] final class Profile[A](p: LazyParsley[A], name: String, profil 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) +private [parsley] final class Impure[A](p: LazyParsley[A]) extends Unary[A, A](p) { + override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Impure(p) override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = p.visit(visitor, context) diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/Visitors.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/Visitors.scala index 3764aa48c..0fd4fdc78 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/Visitors.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/frontend/Visitors.scala @@ -83,7 +83,7 @@ private [parsley] abstract class LazyParsleyIVisitor[-T, +U[+_]] { // scalastyle expectedEnd: String): U[Unit] // Primitive parser visitors. - def visit[A](self: Attempt[A], context: T)(p: LazyParsley[A]): U[A] + def visit[A](self: Atomic[A], context: T)(p: LazyParsley[A]): U[A] def visit[A](self: Look[A], context: T)(p: LazyParsley[A]): U[A] def visit[A](self: NotFollowedBy[A], context: T)(p: LazyParsley[A]): U[Unit] def visit[S](self: Put[S], context: T)(ref: Ref[S], p: LazyParsley[S]): U[Unit] @@ -226,7 +226,7 @@ private [frontend] abstract class GenericLazyParsleyIVisitor[-T, +U[+_]] extends expectedEnd: String): U[Unit] = visitSingleton(self, context) // Primitive overrides. - override def visit[A](self: Attempt[A], context: T)(p: LazyParsley[A]): U[A] = visitUnary(self, context)(p) + override def visit[A](self: Atomic[A], context: T)(p: LazyParsley[A]): U[A] = visitUnary(self, context)(p) override def visit[A](self: Look[A], context: T)(p: LazyParsley[A]): U[A] = visitUnary(self, context)(p) override def visit[A](self: NotFollowedBy[A], context: T)(p: LazyParsley[A]): U[Unit] = visitUnary(self, context)(p) override def visit[S](self: Put[S], context: T)(ref: Ref[S], p: LazyParsley[S]): U[Unit] = visitUnary(self, context)(p) diff --git a/parsley/shared/src/main/scala/parsley/lift.scala b/parsley/shared/src/main/scala/parsley/lift.scala index 1276f3447..26b565107 100644 --- a/parsley/shared/src/main/scala/parsley/lift.scala +++ b/parsley/shared/src/main/scala/parsley/lift.scala @@ -5,7 +5,6 @@ */ package parsley -//TODO: opaque/transparent import parsley.Parsley.{transPure => pure} import parsley.ap._ // scalastyle:ignore underscore.import @@ -56,7 +55,7 @@ private [parsley] trait lift { final def lift1[T1, R] (f: T1 => R, p1: Parsley[T1]): Parsley[R] = - p1.map(f) + p1.map(f).uo("lift1") /** $bodyLift * * @param f $paramLift two. @@ -84,7 +83,7 @@ private [parsley] trait lift { final def lift4[T1, T2, T3, T4, R] (f: (T1, T2, T3, T4) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4]): Parsley[R] = - ap4(pure(f), p1, p2, p3, p4) + ap4(pure(f), p1, p2, p3, p4).uo("lift4") /** $bodyLift * * @param f $paramLift five. @@ -93,7 +92,7 @@ private [parsley] trait lift { final def lift5[T1, T2, T3, T4, T5, R] (f: (T1, T2, T3, T4, T5) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5]): Parsley[R] = - ap5(pure(f), p1, p2, p3, p4, p5) + ap5(pure(f), p1, p2, p3, p4, p5).uo("lift5") /** $bodyLift * * @param f $paramLift six. @@ -102,7 +101,7 @@ private [parsley] trait lift { final def lift6[T1, T2, T3, T4, T5, T6, R] (f: (T1, T2, T3, T4, T5, T6) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6]): Parsley[R] = - ap6(pure(f), p1, p2, p3, p4, p5, p6) + ap6(pure(f), p1, p2, p3, p4, p5, p6).uo("lift6") /** $bodyLift * * @param f $paramLift seven. @@ -111,7 +110,7 @@ private [parsley] trait lift { final def lift7[T1, T2, T3, T4, T5, T6, T7, R] (f: (T1, T2, T3, T4, T5, T6, T7) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7]): Parsley[R] = - ap7(pure(f), p1, p2, p3, p4, p5, p6, p7) + ap7(pure(f), p1, p2, p3, p4, p5, p6, p7).uo("lift7") /** $bodyLift * * @param f $paramLift eight. @@ -121,7 +120,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8]): Parsley[R] = - ap8(pure(f), p1, p2, p3, p4, p5, p6, p7, p8) + ap8(pure(f), p1, p2, p3, p4, p5, p6, p7, p8).uo("lift8") /** $bodyLift * * @param f $paramLift nine. @@ -131,7 +130,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9]): Parsley[R] = - ap9(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9) + ap9(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9).uo("lift9") /** $bodyLift * * @param f $paramLift ten. @@ -141,7 +140,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10]): Parsley[R] = - ap10(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) + ap10(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10).uo("lift10") /** $bodyLift * * @param f $paramLift eleven. @@ -151,7 +150,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11]): Parsley[R] = - ap11(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) + ap11(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11).uo("lift11") /** $bodyLift * * @param f $paramLift twelve. @@ -161,7 +160,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12]): Parsley[R] = - ap12(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) + ap12(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12).uo("lift12") /** $bodyLift * * @param f $paramLift thirteen. @@ -171,7 +170,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13]): Parsley[R] = - ap13(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) + ap13(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13).uo("lift13") /** $bodyLift * * @param f $paramLift fourteen. @@ -181,7 +180,7 @@ private [parsley] trait lift { (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) => R, p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14]): Parsley[R] = - ap14(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) + ap14(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14).uo("lift14") /** $bodyLift * * @param f $paramLift fifteen. @@ -192,7 +191,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15]): Parsley[R] = - ap15(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) + ap15(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15).uo("lift15") /** $bodyLift * * @param f $paramLift sixteen. @@ -203,7 +202,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16]): - Parsley[R] = ap16(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) + Parsley[R] = ap16(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16).uo("lift16") /** $bodyLift * * @param f $paramLift seventeen. @@ -214,7 +213,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17]): Parsley[R] = - ap17(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) + ap17(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17).uo("lift17") /** $bodyLift * * @param f $paramLift eighteen. @@ -225,7 +224,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18]): Parsley[R] = - ap18(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) + ap18(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18).uo("lift18") /** $bodyLift * * @param f $paramLift nineteen. @@ -236,7 +235,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19]): Parsley[R] = - ap19(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) + ap19(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19).uo("lift19") /** $bodyLift * * @param f $paramLift twenty. @@ -247,7 +246,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20]): Parsley[R] = - ap20(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) + ap20(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20).uo("lift20") /** $bodyLift * * @param f $paramLift twenty-one. @@ -258,7 +257,7 @@ private [parsley] trait lift { p1: Parsley[T1], p2: =>Parsley[T2], p3: =>Parsley[T3], p4: =>Parsley[T4], p5: =>Parsley[T5], p6: =>Parsley[T6], p7: =>Parsley[T7], p8: =>Parsley[T8], p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21]): Parsley[R] = - ap21(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) + ap21(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21).uo("lift21") // $COVERAGE-ON$ /** $bodyLift * @@ -271,6 +270,6 @@ private [parsley] trait lift { p9: =>Parsley[T9], p10: =>Parsley[T10], p11: =>Parsley[T11], p12: =>Parsley[T12], p13: =>Parsley[T13], p14: =>Parsley[T14], p15: =>Parsley[T15], p16: =>Parsley[T16], p17: =>Parsley[T17], p18: =>Parsley[T18], p19: =>Parsley[T19], p20: =>Parsley[T20], p21: =>Parsley[T21], p22: =>Parsley[T22]): Parsley[R] = - ap22(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22) + ap22(pure(f), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22).uo("lift22") // scalastyle:on parameter.number ensure.single.space.after.token } diff --git a/parsley/shared/src/test/scala/parsley/internal/deepembedding/frontend/VisitorTests.scala b/parsley/shared/src/test/scala/parsley/internal/deepembedding/frontend/VisitorTests.scala index 5d0094d1b..6b3d60a60 100644 --- a/parsley/shared/src/test/scala/parsley/internal/deepembedding/frontend/VisitorTests.scala +++ b/parsley/shared/src/test/scala/parsley/internal/deepembedding/frontend/VisitorTests.scala @@ -129,7 +129,7 @@ class VisitorTests extends ParsleyTest { new EscapeOneOfExactly(0, Nil, dummySFConfig[Int]()).testV new SoftKeyword("corge", Basic(_ => true), false, dummyLabelConfig, "grault").testV new SoftOperator("garply", Basic(_ => true), Trie.empty[Unit], dummyLabelConfig, "waldo").testV - new Attempt(dummyParser).testV + new Atomic(dummyParser).testV new Look(dummyParser).testV new NotFollowedBy(dummyParser).testV new Put(dummyRef(), dummyParser).testV