diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-11-14 15:45:50 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-11-14 15:45:50 +0700 |
commit | add98e1a1100d5b0fb666ac4669d0a90272959ca (patch) | |
tree | 4e32e92e7bc3a6373f95f04bd28f946b5b100234 /src/main/scala/xyz/driver/pdsuicommon/parsers | |
parent | 2afec69b277c031eb52e1a05e57ff7bb0079f8d1 (diff) | |
parent | 29ee5de759374ceed9c856a51443a3f7c2cec029 (diff) | |
download | rest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.tar.gz rest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.tar.bz2 rest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.zip |
Merge branch 'master' into PDSUI-2345
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuicommon/parsers')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala | 11 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/parsers/SortingParser.scala | 6 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala b/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala index 718a42d..aeb6c16 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala @@ -5,7 +5,6 @@ import java.util.UUID import xyz.driver.pdsuicommon.utils.Implicits.{toCharOps, toStringOps} import fastparse.all._ import fastparse.core.Parsed -import fastparse.parsers.Intrinsics.CharPred import xyz.driver.pdsuicommon.db.{SearchFilterBinaryOperation, SearchFilterExpr, SearchFilterNAryOperation} import xyz.driver.pdsuicommon.utils.Utils._ @@ -150,14 +149,14 @@ object SearchFilterParser { case head :: Nil => atomParser.parse(head) match { - case Parsed.Success(x, _) => x - case e: Parsed.Failure => throw new ParseQueryArgException("filters" -> formatFailure(1, e)) + case Parsed.Success(x, _) => x + case e: Parsed.Failure[_, _] => throw new ParseQueryArgException("filters" -> formatFailure(1, e)) } case xs => val parsed = xs.map(x => atomParser.parse(x)) val failures: Seq[String] = parsed.zipWithIndex.collect { - case (e: Parsed.Failure, index) => formatFailure(index, e) + case (e: Parsed.Failure[_, _], index) => formatFailure(index, e) } if (failures.isEmpty) { @@ -172,8 +171,8 @@ object SearchFilterParser { } } - private def formatFailure(sectionIndex: Int, e: Parsed.Failure): String = { - s"section $sectionIndex: ${ParseError.msg(e.extra.input, e.extra.traced.expected, e.index)}" + private def formatFailure(sectionIndex: Int, e: Parsed.Failure[_, _]): String = { + s"section $sectionIndex: ${fastparse.core.ParseError.msg(e.extra.input, e.extra.traced.expected, e.index)}" } } diff --git a/src/main/scala/xyz/driver/pdsuicommon/parsers/SortingParser.scala b/src/main/scala/xyz/driver/pdsuicommon/parsers/SortingParser.scala index 4bfc669..a04d278 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/parsers/SortingParser.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/parsers/SortingParser.scala @@ -49,7 +49,7 @@ object SortingParser { val parser = sequentialSortingParser(validDimensions.toSeq) parser.parse(rawSorting) match { case Parsed.Success(x, _) => x - case e: Parsed.Failure => + case e: Parsed.Failure[_, _] => throw new ParseQueryArgException("sort" -> formatFailure(e)) } @@ -57,8 +57,8 @@ object SortingParser { } } - private def formatFailure(e: Parsed.Failure): String = { - ParseError.msg(e.extra.input, e.extra.traced.expected, e.index) + private def formatFailure(e: Parsed.Failure[_, _]): String = { + fastparse.core.ParseError.msg(e.extra.input, e.extra.traced.expected, e.index) } } |