Skip to content

Commit 8b011a5

Browse files
authored
Merge pull request #329 from SethTisue/version-bumps
version bumps and code improvement
2 parents 4ff32a8 + df92b08 commit 8b011a5

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.travis.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ import: scala/scala-dev:travis/default.yml
55
language: scala
66

77
scala:
8-
- 3.0.0-M1
8+
- 3.0.0-M2
99
- 2.11.12
1010
- 2.12.12
11-
- 2.13.3
11+
- 2.13.4
1212

1313
env:
1414
- ADOPTOPENJDK=8 SCALAJS_VERSION=
1515
- ADOPTOPENJDK=8 SCALAJS_VERSION=1.3.1
1616
- ADOPTOPENJDK=11 SCALAJS_VERSION=
1717

1818
matrix:
19-
exclude:
20-
- scala: 3.0.0-M1
21-
env: ADOPTOPENJDK=8 SCALAJS_VERSION=1.3.1
2219
include:
2320
- scala: 2.11.12
2421
env: ADOPTOPENJDK=8 SCALANATIVE_VERSION=0.3.9

build.sbt

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatfor
1313

1414
libraryDependencies += "junit" % "junit" % "4.13.1" % Test,
1515
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
16+
// so we can `@nowarn` in test code, but only in test code, so the dependency
17+
// doesn't leak downstream
18+
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.3.1" % Test,
1619

1720
apiMappings ++= scalaInstance.value.libraryJars.collect {
1821
case file if file.getName.startsWith("scala-library") && file.getName.endsWith(".jar") =>

shared/src/main/scala/scala/util/parsing/combinator/PackratParsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ to update each parser involved in the recursion.
211211
case LR(seed ,rule, Some(head)) =>
212212
if(head.getHead != p) /*not head rule, so not growing*/ seed.asInstanceOf[ParseResult[T]]
213213
else {
214-
in.updateCacheAndGet(p, MemoEntry(Right[LR, ParseResult[T]](seed.asInstanceOf[ParseResult[T]])))
214+
in.updateCacheAndGet(p, MemoEntry(Right(seed.asInstanceOf[ParseResult[T]])))
215215
seed match {
216216
case f@Failure(_,_) => f
217217
case e@Error(_,_) => e

shared/src/main/scala/scala/util/parsing/combinator/Parsers.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ trait Parsers {
403403
val res1 = Parser.this(in)
404404
val res2 = q(in)
405405

406-
(res1, res2) match {
406+
// compiler thinks match isn't exhaustive; perhaps it's right, but does that mean there's a bug here?
407+
// that's not clear to me, so for now let's just `@unchecked` it
408+
((res1, res2): @unchecked) match {
407409
case (s1 @ Success(_, next1), s2 @ Success(_, next2)) => if (next2.pos < next1.pos || next2.pos == next1.pos) s1 else s2
408410
case (s1 @ Success(_, _), _) => s1
409411
case (_, s2 @ Success(_, _)) => s2

shared/src/test/scala/scala/util/parsing/combinator/PackratParsersTest.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ private object grammars3 extends StandardTokenParsers with PackratParsers {
190190
| success(Nil)
191191
)
192192

193+
@annotation.nowarn // Some(xs) in pattern isn't exhaustive
193194
def repMany1[T](p: => Parser[T], q: => Parser[T]): Parser[List[T]] =
194-
p~opt(repMany(p,q))~q ^^ {case x~Some(xs)~y => x::xs:::(y::Nil)}
195+
p~opt(repMany(p,q))~q ^^ {case x~Some(xs)~y => x::xs:::(y::Nil)}
195196

196197
}

0 commit comments

Comments
 (0)