Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scala/scala-parser-combinators
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f225fb0
Choose a base ref
...
head repository: scala/scala-parser-combinators
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c4c97ba
Choose a head ref
  • 7 commits
  • 8 files changed
  • 3 contributors

Commits on Oct 10, 2017

  1. Copy the full SHA
    ffaec27 View commit details

Commits on Feb 1, 2018

  1. Copy the full SHA
    fff8f8f View commit details
  2. Merge pull request #137 from SethTisue/bump-versions

    bump various version numbers
    gourlaysama authored Feb 1, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dc88d4d View commit details

Commits on Jun 9, 2018

  1. Merge pull request #129 from justinp/1.0.x

    #128: prevent OutOfBoundsException on trailing newline
    SethTisue authored Jun 9, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c7b62dc View commit details

Commits on May 9, 2019

  1. allow JDK 11 build

    SethTisue committed May 9, 2019
    Copy the full SHA
    23a8cba View commit details

Commits on Oct 23, 2019

  1. allow JDK 13/14 build

    note that the Travis-CI changes don't make the JDK 6 build
    work, but they do allow the JDK 8 one to run
    SethTisue committed Oct 23, 2019
    Copy the full SHA
    d99be7e View commit details
  2. Merge pull request #246 from SethTisue/allow-building-on-jdk14

    allow JDK 13/14 build (on 1.0.x branch)
    SethTisue authored Oct 23, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c4c97ba View commit details
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -23,18 +23,13 @@ env:

script: admin/build.sh

addons:
apt:
packages:
- openjdk-6-jdk

jdk:
- openjdk6
- oraclejdk8
- openjdk8

notifications:
email:
- adriaan.moors@typesafe.com
- adriaan.moors@lightbend.com
- antoine@gourlay.fr

before_cache:
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2002-2013 EPFL
Copyright (c) 2011-2013 Typesafe, Inc.
Copyright (c) 2002-2018 EPFL
Copyright (c) 2011-2018 Lightbend, Inc.

All rights reserved.

@@ -25,4 +25,4 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ As of Scala 2.11, this library is a separate jar that can be omitted from Scala
To depend on scala-parser-combinators in SBT, add something like this to your build.sbt:

```
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6"
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.7"
```

(Assuming you're using a `scalaVersion` for which a scala-parser-combinators is published. The first 2.11 milestone for which this is true is 2.11.0-M4.)
@@ -60,7 +60,7 @@ For a detailed unpacking of this example see
Scala-parser-combinators directly supports scala-js 0.6+, starting with v1.0.5:

```
libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "1.0.6"
libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "1.0.7"
```

## Contributing
9 changes: 7 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -9,7 +9,12 @@ scalaVersionsByJvm in ThisBuild := {
6 -> List(v211 -> true),
7 -> List(v211 -> false),
8 -> List(v212 -> true, v213 -> true, v211 -> false),
9 -> List(v212 -> false, v213 -> false, v211 -> false)
9 -> List(v212 -> false, v213 -> false, v211 -> false),
10 -> List(v212 -> false, v213 -> false, v211 -> false),
11 -> List(v212 -> false, v213 -> false, v211 -> false),
12 -> List(v212 -> false, v213 -> false, v211 -> false),
13 -> List(v212 -> false, v213 -> false, v211 -> false),
14 -> List(v212 -> false, v213 -> false, v211 -> false)
)
}

@@ -22,7 +27,7 @@ lazy val `scala-parser-combinators` = crossProject.in(file(".")).
jvmSettings(scalaModuleSettingsJVM).
settings(
name := "scala-parser-combinators",
version := "1.0.7-SNAPSHOT",
version := "1.0.8-SNAPSHOT",
mimaPreviousVersion := Some("1.0.5"),

apiMappings += (scalaInstance.value.libraryJar ->
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=0.13.18
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.13")
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
Original file line number Diff line number Diff line change
@@ -63,12 +63,14 @@ case class OffsetPosition(source: CharSequence, offset: Int) extends Position {
* @return the line at `offset` (not including a newline)
*/
def lineContents: String = {
val endIndex = if (source.charAt(index(line) - 1) == '\n') {
index(line) - 1
val lineStart = index(line - 1)
val lineEnd = index(line)
val endIndex = if ( lineStart < lineEnd && source.charAt(lineEnd - 1) == '\n') {
lineEnd - 1
} else {
index(line)
lineEnd
}
source.subSequence(index(line - 1), endIndex).toString
source.subSequence(lineStart, endIndex).toString
}

/** Returns a string representation of the `Position`, of the form `line.column`. */
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package scala.util.parsing.input

import org.junit.Test
import org.junit.Assert.assertEquals

class OffsetPositionTest {
@Test
def printLineContentsWithTrailingNewLine: Unit = {
val op = new OffsetPosition("\n", 1)
assertEquals(op.lineContents, "")
}

@Test
def printLineContentsWithEmptySource: Unit = {
val op = new OffsetPosition("", 0)
assertEquals(op.lineContents, "")
}
}