From 452ae1218fc4fe7da1029bb8c3b90d05a1a2dee9 Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Sat, 9 Sep 2023 17:04:51 +0100 Subject: [PATCH] Fixed visitors --- .../internal/deepembedding/frontend/PrimitiveEmbedding.scala | 2 +- .../parsley/internal/deepembedding/frontend/Visitors.scala | 4 ++-- .../internal/deepembedding/frontend/VisitorTests.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 71f1b275a..21bc818c3 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 @@ -47,7 +47,7 @@ private [parsley] final class Span(p: LazyParsley[_]) extends Unary[Any, String] private [parsley] final class Debug[A](p: LazyParsley[A], name: String, ascii: Boolean, break: Breakpoint, watchedRegs: Seq[(Reg[_], String)]) extends Unary[A, A](p) { override def make(p: StrictParsley[A]): StrictParsley[A] = new backend.Debug(p, name, ascii, break, watchedRegs) - override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, name, ascii, break) + override def visit[T, U[+_]](visitor: LazyParsleyIVisitor[T, U], context: T): U[A] = visitor.visit(this, context)(p, name, ascii, break, watchedRegs) } 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) 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 ce9cc83f7..ccec0c06f 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 @@ -75,7 +75,7 @@ private [parsley] abstract class LazyParsleyIVisitor[-T, +U[+_]] { // scalastyle def visit[S](self: Put[S], context: T)(reg: Reg[S], p: LazyParsley[S]): U[Unit] def visit[S, A](self: NewReg[S, A], context: T)(reg: Reg[S], init: LazyParsley[S], body: =>LazyParsley[A]): U[A] def visit(self: Span, context: T)(p: LazyParsley[_]): U[String] - def visit[A](self: Debug[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, break: Breakpoint): U[A] + def visit[A](self: Debug[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, break: Breakpoint, watchedRegs: Seq[(Reg[_], String)]): U[A] def visit[A](self: DebugError[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, errBuilder: ErrorBuilder[_]): U[A] // Selective parser visitors. @@ -217,7 +217,7 @@ private [frontend] abstract class GenericLazyParsleyIVisitor[-T, +U[+_]] extends override def visit[S, A](self: NewReg[S, A], context: T)(reg: Reg[S], init: LazyParsley[S], body: =>LazyParsley[A]): U[A] = visitBinary(self, context)(init, body) override def visit(self: Span, context: T)(p: LazyParsley[_]): U[String] = visitUnary[Any, String](self, context)(p) - override def visit[A](self: Debug[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, break: Breakpoint): U[A] = + override def visit[A](self: Debug[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, break: Breakpoint, watchedRegs: Seq[(Reg[_], String)]): U[A] = visitUnary(self, context)(p) override def visit[A](self: DebugError[A], context: T)(p: LazyParsley[A], name: String, ascii: Boolean, errBuilder: ErrorBuilder[_]): U[A] = visitUnary(self, context)(p) 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 f2a9a98e8..b5685388b 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 @@ -169,7 +169,7 @@ class VisitorTests extends ParsleyTest { new Look(dummyParser).testV new NotFollowedBy(dummyParser).testV new Put(dummyRegister(), dummyParser).testV - new Debug(dummyParser, "fred", false, FullBreak).testV + new Debug(dummyParser, "fred", false, FullBreak, Seq.empty).testV new DebugError(dummyParser, "plugh", false, dummyErrorBuilder).testV new <|>(dummyParser, dummyParser).testV new >>=[Nothing, Nothing](dummyParser, crash).testV