Skip to content

Commit

Permalink
Updated scalatest
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Apr 9, 2021
1 parent 1e23a94 commit 535e7f3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/parsley/errors/revisions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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[_] =>
Expand Down Expand Up @@ -44,4 +45,5 @@ object revisions {
}
/* @since ??? */
//trait Revision2 { this: ErrorBuilder[_] => }
}
}
// $COVERAGE-ON$
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/parsley/internal/errors/Builders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
}

Expand All @@ -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 =>
}

Expand Down
7 changes: 5 additions & 2 deletions src/test/scala/parsley/ParsleyTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 535e7f3

Please sign in to comment.