aboutsummaryrefslogtreecommitdiff
path: root/docs/precedence.md
blob: 417fa455c489d95cf79a8ab2a29d2cfefbd468e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Operating precedence in sloth from highest to lowest.

| Name           | Operators | Associates |
| -------------- | --------- | ---------- |
| parentheses    | ()        | Left       |
| member access  | . ! !! ?. | Left       |
| defaulting     | ?:        | Right      |
| unary          | ! + -     | Right      |
| multiplicative | \* / %    | Left       |
| additive       | + -       | Left       |
| bitwise shift  | << >>     | Left       |
| comparison     | < > <= >= | Left       |
| equality       | == !=     | Left       |
| bitwise        | & ^ \|    | Left       |
| logical and    | &&        | Left       |
| logical or     | \|\|      | Left       |