Skip to content

Feature/scala 2.13 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push]

jobs:
UnitTests:

runs-on: ubuntu-latest

steps:
Expand All @@ -28,6 +29,7 @@ jobs:
run: sbt test

MutationTests:

runs-on: ubuntu-latest

steps:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: scala
scala:
- 2.13.1
- 2.12.8

before_cache:
Expand Down
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "mathimatica-parser"

scalaVersion := "2.12.8"
scalaVersion := "2.13.1"

libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
Expand All @@ -10,6 +10,8 @@ libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.2" % Test
libraryDependencies += "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test

scalacOptions ++= Seq("-deprecation")

// POM settings for Sonatype
organization := "com.github.tomerghelber"
homepage := Some(
Expand Down
2 changes: 1 addition & 1 deletion project/safety.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.leobenkel" % "safety_plugin" % "0.1.4")
addSbtPlugin("com.leobenkel" % "safety_plugin" % "0.1.5")
2 changes: 2 additions & 0 deletions safetyPlugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"sbtVersion": "1.3.4",
"scalaVersions": [
"2.13.1",
"2.13.0",
"2.12.8"
],
"modules": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object NormalForm {
}
private val normalFormFunctionNodeOrdering = {
val functionNameOrdering = TerminalNodeOrdering.on[FunctionNode](_.name)
val functionArgumentsOrdering = Ordering.Iterable(ASTNodeOrdering).on[FunctionNode](_.arguments)
val functionArgumentsOrdering = Ordering.Implicits.seqOrdering(ASTNodeOrdering).on[FunctionNode](_.arguments)
functionNameOrdering thenComparing functionArgumentsOrdering
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ package object mathematica {
.map(_.replaceAll("\\\\", "\\\\")
.replaceAll("\"", "\\\""))
val stringStringGen: Gen[String] = stringWithoutWrappersGen.map(s => "\"" + s + "\"")
val symbolStringGen: Gen[String] = for (head <- Gen.alphaChar; last <- Gen.alphaNumStr) yield { head + last }
val symbolStringGen: Gen[String] = for (head <- Gen.alphaChar; last <- Gen.alphaNumStr) yield { s"$head$last" }
private val integerGen: Gen[Int] = Gen.chooseNum(Int.MinValue, Int.MaxValue)
private val longGen: Gen[Long] = Gen.chooseNum(Long.MinValue, Long.MaxValue)
val integerStringGen: Gen[String] = longGen.map(_.toString)
val rationalStringGen: Gen[String] = for(q <-longGen; p <-longGen if p != 0) yield { q + "/" + p}
val rationalStringGen: Gen[String] = for(q <-longGen; p <-longGen if p != 0) yield { s"$q/$p" }
val floatStringGen: Gen[String] = Gen.chooseNum(Double.MinValue, Double.MaxValue).map(_.toString)
val scientificNotationGen: Gen[String] = Gen.chooseNum(Double.MinValue, Double.MaxValue).map(BigDecimal(_).toString)
val numberStringGen: Gen[String] = Gen.oneOf(integerStringGen, rationalStringGen, floatStringGen,
Expand Down