Skip to content

Commit 1a0b1e0

Browse files
committed
Cross-build with Scala 2.13.0
1 parent 8fa09a2 commit 1a0b1e0

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ javaOptions in IntegrationTest ++= Seq("-Xss128M")
1414

1515
fork in IntegrationTest := true
1616

17-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test,it"
17+
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test,it"
1818

1919
logBuffered in IntegrationTest := false
2020

@@ -23,8 +23,8 @@ parallelExecution in Test := true
2323
lazy val commonSettings = Seq(
2424
organization := "com.regblanc",
2525
name := "scala-smtlib",
26-
scalaVersion := "2.11.8",
27-
crossScalaVersions := Seq("2.10.4", "2.11.8", "2.12.1")
26+
scalaVersion := "2.12.8",
27+
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.12.8", "2.13.0")
2828
)
2929

3030
lazy val root = (project in file(".")).

src/main/scala/smtlib/common/Binary.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Binary private(val digits: List[Boolean]) {
1616

1717
def toLongBits: Long = {
1818
val allReversedBits: List[Boolean] = digits.take(64).reverse.padTo(64, false)
19-
allReversedBits.foldRight(0l)((bit, bits) => ((bits<<1) | (if(bit) 1 else 0)))
19+
allReversedBits.foldRight(0L)((bit, bits) => ((bits<<1) | (if(bit) 1 else 0)))
2020
}
2121

2222
//transform to a 32 bits integer, respecting 2 complements

src/main/scala/smtlib/common/Hexadecimal.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ object Hexadecimal {
113113
while(i < 8) {
114114
val end = rest & 15
115115
rest = rest >> 4
116-
repr = toDigit(end) + repr
116+
repr = s"${toDigit(end)}$repr"
117117
i += 1
118118
}
119119

src/main/scala/smtlib/extensions/tip/Parser.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ class Parser(lexer: Lexer) extends parser.Parser(lexer) {
207207
if ((funDec +: funDecs).exists(_.isLeft)) {
208208
DefineFunsRecPar(funDec +: funDecs, body +: bodies)
209209
} else {
210-
DefineFunsRec((funDec +: funDecs).map(_.right.get), body +: bodies)
210+
val funsRec = (funDec +: funDecs).collect { case Right(funDec) => funDec }
211+
DefineFunsRec(funsRec, body +: bodies)
211212
}
212213

213214
case LT.DeclareDatatypes =>

src/main/scala/smtlib/parser/ParserCommands.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ trait ParserCommands { this: ParserCommon with ParserTerms =>
219219
constructors.append(parseConstructor)
220220
}
221221
eat(Tokens.CParen)
222-
(name, constructors)
222+
(name, constructors.toSeq)
223223
}
224224

225225
def parseConstructor: Constructor = {

src/main/scala/smtlib/printer/PrintingContext.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class PrintingContext(writer: Writer) {
103103

104104
protected def printString(value: String): Unit = {
105105
print("\"")
106-
print(value.flatMap(c => if (c == '"') "\"\"" else List(c)))
106+
print(value.flatMap(c => if (c == '"') "\"\"" else c.toString))
107107
print("\"")
108108
}
109109

0 commit comments

Comments
 (0)