Skip to content

Commit

Permalink
resolve some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
pieter-bos committed Oct 4, 2023
1 parent 20dedd3 commit b17b99a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/colhelper/ColDefs.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import scala.collection.mutable
import scala.meta._

/**
Expand Down Expand Up @@ -45,9 +44,9 @@ object ColDefs {
)

def scopes(kind: String): Term.Name =
Term.Name(kind.charAt(0).toLower + kind.substring(1) + "s")
Term.Name(kind.charAt(0).toLower.toString + kind.substring(1) + "s")

val DECLARATION_NAMESPACE: mutable.ListMap[String, Seq[String]] = mutable.ListMap(
val DECLARATION_NAMESPACE: Map[String, Seq[String]] = Map(
"GlobalDeclaration" -> Seq("Program"),
"ClassDeclaration" -> Seq("Program"),
"ADTDeclaration" -> Seq("Program"),
Expand Down
8 changes: 4 additions & 4 deletions src/colhelper/ColDescription.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ColDefs._

import java.io.File
import java.nio.file.Files
import scala.collection.mutable
import scala.collection.immutable.ListMap
import scala.collection.mutable.ArrayBuffer
import scala.meta._

Expand Down Expand Up @@ -66,7 +66,7 @@ case class ClassDef(names: Seq[String], params: List[Term.Param], blameType: Opt

class ColDescription {
val defs: ArrayBuffer[ClassDef] = ArrayBuffer()
val bases: mutable.ListMap[String, List[String]] = mutable.ListMap()
var bases: ListMap[String, List[String]] = ListMap()
val families: ArrayBuffer[String] = ArrayBuffer()

def supports(baseType: String)(cls: String): Boolean = {
Expand Down Expand Up @@ -193,12 +193,12 @@ class ColDescription {
*/
def collectBases(stat: Stat): Unit = stat match {
case Defn.Class(_, name, _, _, Template(_, inits, _, _)) =>
bases(name.value) = inits.collect {
bases += name.value -> inits.collect {
case Init(Type.Name(name), _, _) => name
case Init(Type.Apply(Type.Name(name), _), _, _) => name
}
case Defn.Trait(_, name, _, _, Template(_, inits, _, _)) =>
bases(name.value) = inits.collect {
bases += name.value -> inits.collect {
case Init(Type.Name(name), _, _) => name
case Init(Type.Apply(Type.Name(name), _), _, _) => name
}
Expand Down
2 changes: 1 addition & 1 deletion src/colhelper/ColHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import scala.meta.prettyprinters.Show
object ColHelper {
def main(args: Array[String]): Unit =
ColHelper().generate(
args.tail.map(new File(_)),
args.toSeq.tail.map(new File(_)),
new File(args.head),
(f, data) => {
new File(f.getParent).mkdirs()
Expand Down
2 changes: 1 addition & 1 deletion test/main/vct/test/integration/helper/ExampleFiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ case object ExampleFiles {

def find(directory: File): Seq[File] =
Option(directory.listFiles()) match {
case Some(files) => files.filterNot(f => EXCLUSIONS.exists(_(f))).sortBy(_.getName).flatMap(f => if(f.isDirectory) find(f) else Seq(f))
case Some(files) => files.toSeq.filterNot(f => EXCLUSIONS.exists(_(f))).sortBy(_.getName).flatMap(f => if(f.isDirectory) find(f) else Seq(f))
case None => Nil
}
}

0 comments on commit b17b99a

Please sign in to comment.