Skip to content
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

chore(deps): bump scala-library from 2.13.6 to 2.13.8 #389

Merged
merged 3 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<version.java>1.8</version.java>
<scala.version>2.13.6</scala.version>
<scala.version>2.13.8</scala.version>
<scala.binary.version>2.13.6</scala.binary.version>
<version.log4j>2.17.1</version.log4j>
<plugin.version.shade>3.2.4</plugin.version.shade>
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/camunda/feel/impl/parser/FeelParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ object FeelParser {
private def expLvl2[_: P]: P[Exp] = conjunction

private def expLvl3[_: P]: P[Exp] =
expLvl4.flatMap(optional(comparison)) | simplePositiveUnaryTest
expLvl4.flatMap(optional(comparison(_))) | simplePositiveUnaryTest

private def expLvl4[_: P]: P[Exp] = mathOperator

Expand Down Expand Up @@ -356,7 +356,7 @@ object FeelParser {
// --------------- value/terminal parsers ---------------

private def value[_: P]: P[Exp] =
terminalValue.flatMap(optional(chainedValueOp))
terminalValue.flatMap(optional(chainedValueOp(_)))

private def terminalValue[_: P]: P[Exp] =
temporal | functionInvocation | variableRef | literal | inputValue | functionDefinition | "(" ~ expression ~ ")"
Expand Down Expand Up @@ -508,7 +508,7 @@ object FeelParser {

// operators of values that can be chained multiple times (e.g. `a.b.c`, `a[1][2]`, `a.b[1].c`)
private def chainedValueOp[_: P](value: Exp): P[Exp] =
(path(value) | filter(value)).flatMap(optional(chainedValueOp))
(path(value) | filter(value)).flatMap(optional(chainedValueOp(_)))

private def path[_: P](value: Exp): P[Exp] =
P(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ class InterpreterListExpressionTest
it should "be filtered multiple times (in a context)" in {
val listOfLists = List(List(1))

eval("{z: x.y[1][1]}.z", Map("x" -> Map("y" -> listOfLists))) should be(ValNumber(1))
eval("{z: x.y[1][1][1]}.z", Map("x" -> Map("y" -> List(listOfLists)))) should be(ValNumber(1))
eval("{z: x.y[1][1][1][1]}.z", Map("x" -> Map("y" -> List(List(listOfLists))))) should be(ValNumber(1))
eval("{z: x.y[1][1]}.z", Map("x" -> Map("y" -> listOfLists))) should be(
ValNumber(1))
eval("{z: x.y[1][1][1]}.z", Map("x" -> Map("y" -> List(listOfLists)))) should be(
ValNumber(1))
eval("{z: x.y[1][1][1][1]}.z",
Map("x" -> Map("y" -> List(List(listOfLists))))) should be(
ValNumber(1))
}

it should "fail if one element fails" in {
Expand Down Expand Up @@ -251,7 +255,7 @@ class InterpreterListExpressionTest
ValNumber(21))))
}

private val hugeList: List[Int] = (1 to 10_000).toList
private val hugeList: List[Int] = (1 to 10000).toList

"A huge list" should "be defined as range" in {
eval("for x in 1..10000 return x") should be(
Expand Down Expand Up @@ -293,12 +297,12 @@ class InterpreterListExpressionTest
it should "be filtered" in {
eval("xs[item <= 5000]", Map("xs" -> hugeList)) should be(
ValList(
hugeList.take(5_000).map(ValNumber(_))
hugeList.take(5000).map(ValNumber(_))
))
}

it should "be accessed by index" in {
eval("xs[-1]", Map("xs"->hugeList)) should be (
eval("xs[-1]", Map("xs" -> hugeList)) should be(
ValNumber(hugeList.last)
)
}
Expand Down