Skip to content

Commit efa3bec

Browse files
authored
Update CONTRIBUTING.md
1 parent bc14ffa commit efa3bec

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Example: Zero-bases index list access `[1,2,3][0]` instead of `[1,2,3][1]`
108108
* Adjust the list access in [FeelInterpreter.scala](src/main/scala/org/camunda/feel/impl/interpreter/FeelInterpreter.scala)
109109
* Note: The entry point of the evaluation is `def eval(expression: Exp)`
110110
* 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) =>`
112112
* Change the access behavior in `private def filterList(list: List[Val], index: Number)`
113113
* Adjust the relevant test cases in [InterpreterListExpressionTest.scala](src/test/scala/org/camunda/feel/impl/interpreter/InterpreterListExpressionTest.scala)
114114
* 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
124124
* [Blog: Easy Parsing with Parser Combinators](https://www.lihaoyi.com/post/EasyParsingwithParserCombinators.html)
125125
* [Blog: Build your own Programming Language with Scala](https://www.lihaoyi.com/post/BuildyourownProgrammingLanguagewithScala.html)
126126

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 ???
131140

132141

133142
## Public API and backward compatibility

0 commit comments

Comments
 (0)