Skip to content

Commit

Permalink
docs: move quirks to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Oct 18, 2023
1 parent d7820ff commit bcd969f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
13 changes: 13 additions & 0 deletions QUIRKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Quirks & Irregularities
Syntax choices that make the grammar hard to parse and represent as AST in a
way that is easy to maintain:

- `d2:relationshipCount` is the only function expecting a quoted `UID`
- a `programRuleStringVariableName` is any string and only identifiable having
a special meaning by its position as argument to certain functions
- `PS_EVENTDATE:` is a tag for a `UID` for a dataResolver value but does not use the
`#{...}` wrapper and can therefore easily be confused for a named function
- functions accepting dataResolver item values do not accept all dataResolver item value types
that can occur on top level.
- the `de:*`-functions contain `:` which is hard to distinguish from a tag
- `orgUnit.*`-functions contain `.` which is hard to distinguish from a method
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,4 @@ To select which expression is used the `Expression` is parameterized with a `Mod
* `INDICATOR_EXPRESSION`: Computes a number for an indicator expression (ad-hoc aggregate data computation)
* `PROGRAM_INDICATOR_EXPRESSION`: Computes a number for a program indicator expression (persisted aggregate data computation)
* `RULE_ENGINE_CONDITION`: Computes a boolean to check if a rule applies
* `RULE_ENGINE_ACTION`: Computes a boolean, string, number or date from a rule

### Quirks & Irregularities
Syntax choices that make the grammar hard to parse and represent as AST in a
way that is easy to maintain:

- `d2:relationshipCount` is the only function expecting a quoted `UID`
- a `programRuleStringVariableName` is any string and only identifiable having
a special meaning by its position as argument to certain functions
- `PS_EVENTDATE:` is a tag for a `UID` for a dataResolver value but does not use the
`#{...}` wrapper and can therefore easily be confused for a named function
- functions accepting dataResolver item values do not accept all dataResolver item value types
that can occur on top level.
- the `de:*`-functions contain `:` which is hard to distinguish from a tag
- `orgUnit.*`-functions contain `.` which is hard to distinguish from a method
* `RULE_ENGINE_ACTION`: Computes a boolean, string, number or date from a rule

0 comments on commit bcd969f

Please sign in to comment.