Skip to content

Commit

Permalink
Add operators precedence documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
homersimpsons committed May 3, 2024
1 parent e0535ef commit f2d4f91
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions reference/formats/expression_language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,51 @@ Other Operators
* ``?.`` (:ref:`null-safe operator <component-expression-null-safe-operator>`)
* ``??`` (:ref:`null-coalescing operator <component-expression-null-coalescing-operator>`)

Operators Precedence
~~~~~~~~~~~~~~~~~~~~

The following table summarize the operators and their precedence. It can be useful to understand the actual behavior of an expression.

To avoid ambiguities it is a good practice to add parentheses.

============= ==========
Operator Precedence
============= ==========
`not` 50
`!` 50
`-` 500
`+` 500
`or` 10
`||` 10
`and` 15
`&&` 15
`|` 16
`^` 17
`&` 18
`==` 20
`===` 20
`!=` 20
`!==` 20
`<` 20
`>` 20
`>=` 20
`<=` 20
`not in` 20
`in` 20
`contains` 20
`starts with` 20
`ends with` 20
`matches` 20
`..` 25
`+` 30
`-` 30
`~` 40
`*` 60
`/` 60
`%` 60
`**` 200
============= ==========

Built-in Objects and Variables
------------------------------

Expand Down

0 comments on commit f2d4f91

Please sign in to comment.