diff --git a/build.sbt b/build.sbt index 06501a68e..32148fad9 100644 --- a/build.sbt +++ b/build.sbt @@ -42,7 +42,7 @@ def extraSources(rootSrcFile: File, base: String, version: String): Seq[File] = def scalaTestDependency(version: String): String = Map("0.27.0-RC1" -> "3.2.2", "3.0.0-M3" -> "3.2.3") - .getOrElse(version, "3.2.6") + .getOrElse(version, "3.2.7") val PureVisible: CrossType = new CrossType { def projectDir(crossBase: File, projectType: String): File = diff --git a/src/main/scala/parsley/errors/revisions.scala b/src/main/scala/parsley/errors/revisions.scala index 66bb25bb9..b6b5ab002 100644 --- a/src/main/scala/parsley/errors/revisions.scala +++ b/src/main/scala/parsley/errors/revisions.scala @@ -9,6 +9,7 @@ package parsley.errors * `Revision0` again. * @since 3.0.0 */ +// $COVERAGE-OFF$ object revisions { /** @since 3.0.0 */ trait Revision0 extends Revision1 { this: ErrorBuilder[_] => @@ -44,4 +45,5 @@ object revisions { } /* @since ??? */ //trait Revision2 { this: ErrorBuilder[_] => } -} \ No newline at end of file +} +// $COVERAGE-ON$ \ No newline at end of file diff --git a/src/main/scala/parsley/internal/deepembedding/IntrinsicEmbedding.scala b/src/main/scala/parsley/internal/deepembedding/IntrinsicEmbedding.scala index c00716007..d18001752 100644 --- a/src/main/scala/parsley/internal/deepembedding/IntrinsicEmbedding.scala +++ b/src/main/scala/parsley/internal/deepembedding/IntrinsicEmbedding.scala @@ -37,7 +37,7 @@ private [parsley] final class Lift3[A, B, C, D](private [Lift3] val f: (A, B, C) } } -private [parsley] final object Eof extends Singleton[Unit]("eof", instructions.Eof) +private [parsley] object Eof extends Singleton[Unit]("eof", instructions.Eof) private [parsley] final class Modify[S](val reg: Reg[S], f: S => S) extends Singleton[Unit](s"modify($reg, ?)", new instructions.Modify(reg.addr, f)) with UsesRegister diff --git a/src/main/scala/parsley/internal/deepembedding/TokenEmbedding.scala b/src/main/scala/parsley/internal/deepembedding/TokenEmbedding.scala index 5700ca373..cd4e6ef18 100644 --- a/src/main/scala/parsley/internal/deepembedding/TokenEmbedding.scala +++ b/src/main/scala/parsley/internal/deepembedding/TokenEmbedding.scala @@ -16,19 +16,19 @@ private [parsley] final class Comment(start: String, end: String, line: String, private [parsley] final class Sign[A](ty: SignType) extends Singleton[A => A]("sign", new instructions.TokenSign(ty)) -private [parsley] final object Natural +private [parsley] object Natural extends Singleton[Int]("natural", instructions.TokenNatural) -private [parsley] final object Float +private [parsley] object Float extends Singleton[Double]("float", instructions.TokenFloat) -private [parsley] final object Escape +private [parsley] object Escape extends Singleton[Char]("escape", new instructions.TokenEscape) private [parsley] final class StringLiteral(ws: TokenSet) extends Singleton[String]("stringLiteral", new instructions.TokenString(ws)) -private [parsley] final object RawStringLiteral +private [parsley] object RawStringLiteral extends Singleton[String]("rawStringLiteral", instructions.TokenRawString) private [parsley] class NonSpecific(combinatorName: String, name: String, illegalName: String, start: TokenSet, diff --git a/src/main/scala/parsley/internal/errors/Builders.scala b/src/main/scala/parsley/internal/errors/Builders.scala index 064d3fc96..51d740477 100644 --- a/src/main/scala/parsley/internal/errors/Builders.scala +++ b/src/main/scala/parsley/internal/errors/Builders.scala @@ -20,7 +20,7 @@ private [parsley] abstract class LineBuilder { @tailrec private final def getLinesBefore(offset: Int, i: Int, lines: mutable.ListBuffer[String]): Unit = if (i >= 0) getLineWithEndPoints(offset) match { case Some((line, startOffset, _)) => line +=: lines - getLinesBefore(startOffset-1, i - 1, lines) + getLinesBefore(startOffset - 1, i - 1, lines) case None => } @@ -33,7 +33,7 @@ private [parsley] abstract class LineBuilder { private final def getLinesAfter(offset: Int, i: Int, lines: mutable.ListBuffer[String]): Unit = if (i >= 0) getLineWithEndPoints(offset) match { case Some((line, _, endOffset)) => lines += line - getLinesAfter(endOffset+1, i - 1, lines) + getLinesAfter(endOffset + 1, i - 1, lines) case None => } diff --git a/src/test/scala/parsley/ParsleyTest.scala b/src/test/scala/parsley/ParsleyTest.scala index b037998c9..a4e876f42 100644 --- a/src/test/scala/parsley/ParsleyTest.scala +++ b/src/test/scala/parsley/ParsleyTest.scala @@ -19,7 +19,7 @@ case class Raw(item: String) extends TestErrorItem case class Named(item: String) extends TestErrorItem case object EndOfInput extends TestErrorItem -class TestErrorBuilder extends ErrorBuilder[TestError] with revisions.Revision0 { +class TestErrorBuilder extends ErrorBuilder[TestError] with revisions.Revision1 { override def format(pos: Position, source: Source, lines: ErrorInfoLines): TestError = TestError(pos, lines) type Position = (Int, Int) @@ -50,7 +50,10 @@ class TestErrorBuilder extends ErrorBuilder[TestError] with revisions.Revision0 override def message(msg: String): Message = msg type LineInfo = Unit - override def lineInfo(line: String, errorPointsAt: Int): LineInfo = () + override def lineInfo(line: String, linesBefore: List[String], linesAfter: List[String], errorPointsAt: Int): Unit = () + + override val numLinesBefore: Int = 2 + override val numLinesAfter: Int = 2 type Item = TestErrorItem type Raw = parsley.Raw