From dcb5c32337e56b7ef816a5d0ffd0353d53eba5e0 Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Fri, 27 Dec 2024 20:02:25 +0000 Subject: [PATCH] refactor: renamed alt1 and alt2 to avoid shadowing --- .../deepembedding/backend/AlternativeEmbedding.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 2addd44b7..94d34406e 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 @@ -50,12 +50,12 @@ private [deepembedding] final class Choice[A](private [backend] val alt1: Strict alts.addOne(p) alts.stealAll(alts_) ret - case Choice(_, Choice(alt1, alt2, alts: SinglyLinkedList[StrictParsley[A]]), alts_) => + case Choice(_, Choice(alt1_, alt2_, alts: SinglyLinkedList[StrictParsley[A]]), alts_) => assume(!alts.exists(_.isInstanceOf[Choice[_]]), "alts can never contain a choice") assume(!alts_.exists(_.isInstanceOf[Choice[_]]), "alts_ can never contain a choice") - this.alt2 = alt1 + this.alt2 = alt1_ this.alts = alts - alts.prependOne(alt2) + alts.prependOne(alt2_) alts.stealAll(alts_) this case _ => this