You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ Example: Zero-bases index list access `[1,2,3][0]` instead of `[1,2,3][1]`
108
108
* Adjust the list access in [FeelInterpreter.scala](src/main/scala/org/camunda/feel/impl/interpreter/FeelInterpreter.scala)
109
109
* Note: The entry point of the evaluation is `def eval(expression: Exp)`
110
110
* Note: The list access is parsed as `Filter(list, filter)`
111
-
* Note: Inspect the call hierachie starting from `def eval(expression: Exp)` and looking for `case Filter(list, filter) =>`
111
+
* Note: Inspect the call hierarchy starting from `def eval(expression: Exp)` and looking for `case Filter(list, filter) =>`
112
112
* Change the access behavior in `private def filterList(list: List[Val], index: Number)`
113
113
* Adjust the relevant test cases in [InterpreterListExpressionTest.scala](src/test/scala/org/camunda/feel/impl/interpreter/InterpreterListExpressionTest.scala)
114
114
* Note: The test cases are grouped by value type
@@ -124,10 +124,19 @@ Modifying the FEEL parser is more complex and requires some knowledge about the
124
124
*[Blog: Easy Parsing with Parser Combinators](https://www.lihaoyi.com/post/EasyParsingwithParserCombinators.html)
125
125
*[Blog: Build your own Programming Language with Scala](https://www.lihaoyi.com/post/BuildyourownProgrammingLanguagewithScala.html)
126
126
127
-
Example: ???
128
-
129
-
* Adjust the parsing behavior in [FeelParser.scala](src/main/scala/org/camunda/feel/impl/parser/FeelParser.scala)
130
-
* Verify the behavior by writing test cases in ?
127
+
Example: Add the nullish coalescing operator `??`: `null ?? "default"`
128
+
129
+
* Extend the parsing model in [Exp.scala](src/main/scala/org/camunda/feel/syntaxtree/Exp.scala)
130
+
* Add a new type `case class NullishCoalescing(value: Exp, alternative: Exp) extends Exp`
131
+
* Extend the parsing behavior in [FeelParser.scala](src/main/scala/org/camunda/feel/impl/parser/FeelParser.scala)
132
+
* Add a new private method: `private def nullishCoalesching[_: P](value: Exp): P[Exp] = ???`
133
+
* Implement the parser: `P("??" ~ expLvl4)`
134
+
* Note: the parser uses levels for a hierarchy to define precedence and avoid left recursion
135
+
* Build the parsed expression: `.map { NullishCoalescing(value, _) }`
136
+
* Add the new parser to the suitable level
137
+
* Add the new operator in [FeelInterpreter.scala](src/main/scala/org/camunda/feel/impl/interpreter/FeelInterpreter.scala)
138
+
* ???
139
+
* Verify the behavior by writing test cases in ???
0 commit comments