Skip to content

Commit bc14ffa

Browse files
authored
Update CONTRIBUTING.md
1 parent 84c8663 commit bc14ffa

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If you have an idea of how to improve the project, please create a [new issue](h
1414

1515
### Providing pull requests
1616

17-
Do you want to provide a bug fix or an inprovement? Great! :tada:
17+
Do you want to provide a bug fix or an improvement? Great! :tada:
1818

1919
Before you start coding, make sure that there is a related issue. The issue helps to confirm that the behavior is unexpected, or the idea of the improvement is valid. (Following the rule "Talk, then code")
2020

@@ -23,6 +23,8 @@ Before you open a pull request:
2323
* Run all tests to verify you don't break anything
2424
* Build the project with Maven to format the code
2525

26+
If you added a new feature, please add it to the [Camunda docs](https://docs.camunda.io/docs/next/components/modeler/feel/language-guide/feel-expressions-introduction/) by contributing its documentation to the [repository](https://github.com/camunda/camunda-docs).
27+
2628
## Building the project from source
2729

2830
You can build the project with [Maven](http://maven.apache.org).
@@ -75,11 +77,10 @@ If you're new and want to contribute to the project, check out the following ste
7577

7678
### Adding a new built-in function
7779

78-
The built-in functions are grouped by their main argument type, following the DMN specification.
79-
8080
Example: Add a new string function `reverse(value: string): string`
8181

8282
* Implement the function in [StringBuiltinFunctions.scala](src/main/scala/org/camunda/feel/impl/builtin/StringBuiltinFunctions.scala)
83+
* Note: the built-in functions are grouped by their main argument type
8384
* Add a new private method `reverseFunction` and use the method `builtinFunction()`
8485
* `params` returns the argument list: `params = List("value")`
8586
* `invoke` is called when the function is invoked
@@ -100,14 +101,30 @@ Example: Add a new string function `reverse(value: string): string`
100101
* Add the function to the page, describe the behavior, and provide a few examples
101102
* Open a pull request and link to the FEEL issue and your pull request
102103

104+
### Fix or extend the evaluation
105+
106+
Example: Zero-bases index list access `[1,2,3][0]` instead of `[1,2,3][1]`
107+
108+
* Adjust the list access in [FeelInterpreter.scala](src/main/scala/org/camunda/feel/impl/interpreter/FeelInterpreter.scala)
109+
* Note: The entry point of the evaluation is `def eval(expression: Exp)`
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) =>`
112+
* Change the access behavior in `private def filterList(list: List[Val], index: Number)`
113+
* Adjust the relevant test cases in [InterpreterListExpressionTest.scala](src/test/scala/org/camunda/feel/impl/interpreter/InterpreterListExpressionTest.scala)
114+
* Note: The test cases are grouped by value type
115+
* Run all tests to verify that other cases are not broken
116+
* Run the Maven build to format the code
117+
* Open a pull request and link to the FEEL issue
118+
* Then, adjust the documentation in the [Camunda docs](https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-list-expressions/#get-element)
119+
103120
### Fix or extend the parsing
104121

105122
Modifying the FEEL parser is more complex and requires some knowledge about the parsing library. Here are some useful resources:
106123
* [FastParse documentation](https://com-lihaoyi.github.io/fastparse/)
107124
* [Blog: Easy Parsing with Parser Combinators](https://www.lihaoyi.com/post/EasyParsingwithParserCombinators.html)
108125
* [Blog: Build your own Programming Language with Scala](https://www.lihaoyi.com/post/BuildyourownProgrammingLanguagewithScala.html)
109126

110-
Example: ?
127+
Example: ???
111128

112129
* Adjust the parsing behavior in [FeelParser.scala](src/main/scala/org/camunda/feel/impl/parser/FeelParser.scala)
113130
* Verify the behavior by writing test cases in ?

0 commit comments

Comments
 (0)