Skip to content

Commit

Permalink
Changed import (wildcard) syntax, removed package objects, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvreeze committed Apr 1, 2023
1 parent 5e07d0c commit b6a85b5
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -20,7 +20,7 @@ ThisBuild / crossScalaVersions := crossScalaVer

ThisBuild / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case (Some((3, _))) =>
Seq("-unchecked", "-deprecation", "-Xfatal-warnings")
Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings")
case _ =>
Seq("-Wconf:cat=unused-imports:w,cat=unchecked:w,cat=deprecation:w,cat=feature:w,cat=lint:w", "-Ytasty-reader", "-Xsource:3")
})
Expand Down
Expand Up @@ -17,7 +17,7 @@
package eu.cdevreeze.xpathparser.parse

import scala.collection.mutable
import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters.*

import cats.parse.{Parser => P}
import eu.cdevreeze.xpathparser.ast.XPathExpr
Expand Down
Expand Up @@ -22,4 +22,4 @@ package eu.cdevreeze.xpathparser
* @author
* Chris de Vreeze
*/
package object ast
package ast
Expand Up @@ -23,4 +23,4 @@ package eu.cdevreeze.xpathparser
* @author
* Chris de Vreeze
*/
package object common
package common
Expand Up @@ -18,10 +18,10 @@ package eu.cdevreeze.xpathparser.parse

import eu.cdevreeze.xpathparser.ast.BracedUriLiteral
import eu.cdevreeze.xpathparser.ast.StringLiteral
import cats.parse.Accumulator0._
import cats.parse.Accumulator0.*
import cats.parse.{Parser => P}

import scala.util.chaining._
import scala.util.chaining.*

/**
* Delimiting terminal symbols. No whitespace is skipped during this tokenization. Lookahead is applied when needed to
Expand Down
Expand Up @@ -17,7 +17,7 @@
package eu.cdevreeze.xpathparser.parse

import cats.data.NonEmptyVector
import eu.cdevreeze.xpathparser.ast._
import eu.cdevreeze.xpathparser.ast.*
import cats.parse.{Parser => P}

/**
Expand All @@ -44,7 +44,7 @@ object XPathElemParser:
// TODO Improve, improve, improve. Study XPath spec more closely, use cats-parse in a better way.
// TODO Also make code complete and more robust, (slightly) improve the AST class hierarchy, etc.

import Whitespace._
import Whitespace.*

private val DT = DelimitingTerminals
private val NDT = NonDelimitingTerminals
Expand Down
Expand Up @@ -32,7 +32,7 @@ import cats.parse.{Parser => P}
*/
object XPathParser:

import Whitespace._
import Whitespace.*

/**
* Parser for an XPath expression. Usage: `xpathExpr.parse(xpathString)`. Comments are not supported, so will lead to
Expand Down
Expand Up @@ -22,4 +22,4 @@ package eu.cdevreeze.xpathparser
* @author
* Chris de Vreeze
*/
package object parse
package parse
Expand Up @@ -154,4 +154,4 @@ object ElemApi:
/**
* Element predicate that returns true for each element.
*/
val anyElem: ElemApi[_] => Boolean = { _ => true }
val anyElem: ElemApi[?] => Boolean = { _ => true }
Expand Up @@ -24,7 +24,7 @@ import scala.reflect.ClassTag
* @author
* Chris de Vreeze
*/
trait ElemLike[E <: ElemLike[E]] extends ElemApi[E] { self: E =>
transparent trait ElemLike[E <: ElemLike[E]] extends ElemApi[E] { self: E =>

import ElemApi.anyElem

Expand Down
Expand Up @@ -27,4 +27,4 @@ package eu.cdevreeze.xpathparser
* @author
* Chris de Vreeze
*/
package object queryapi
package queryapi
Expand Up @@ -22,4 +22,4 @@ package eu.cdevreeze.xpathparser
* @author
* Chris de Vreeze
*/
package object util
package util
Expand Up @@ -84,7 +84,7 @@ class ParseXPathTest extends AnyFunSuite:

import cats.parse.{Parser => P}

import XPathElemParser._
import XPathElemParser.*
import XPathParser.xpathExpr

private def throwParseError(exprString: String): Nothing = sys.error(s"Could not parse expression: $exprString")
Expand Down

0 comments on commit b6a85b5

Please sign in to comment.