diff --git a/parsley/shared/src/main/scala/parsley/position.scala b/parsley/shared/src/main/scala/parsley/position.scala index 0b4db63aa..457c93dcc 100644 --- a/parsley/shared/src/main/scala/parsley/position.scala +++ b/parsley/shared/src/main/scala/parsley/position.scala @@ -106,6 +106,8 @@ object position { */ val offset: Parsley[Int] = internalOffset - //TODO: document and test + private [parsley] def withSpan[A, S](end: Parsley[S])(p: Parsley[A]): Parsley[(S, A, S)] = (end, p, end).zipped + + //TODO: test and document def withWidth[A](p: Parsley[A]): Parsley[(A, Int)] = (offset, p, offset).zipped((s, x, e) => (x, e-s)) } diff --git a/project/mima.scala b/project/mima.scala index 388607453..b4dab7eac 100644 --- a/project/mima.scala +++ b/project/mima.scala @@ -26,6 +26,8 @@ object mima { ProblemFilters.exclude[DirectMissingMethodProblem]("parsley.token.errors.*.label"), ProblemFilters.exclude[IncompatibleMethTypeProblem]("parsley.token.errors.*.this"), ProblemFilters.exclude[IncompatibleMethTypeProblem]("parsley.errors.helpers#WhitespaceOrUnprintable.unapply"), + ProblemFilters.exclude[DirectMissingMethodProblem]("parsley.position.internalOffsetSpan"), + ProblemFilters.exclude[DirectMissingMethodProblem]("parsley.position.spanWith"), // Expression refactor ProblemFilters.exclude[ReversedMissingMethodProblem]("parsley.expr.Fixity.chain"), ProblemFilters.exclude[ReversedMissingMethodProblem]("parsley.expr.Ops.chain"),