-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added operator precedence to docs (#5656)
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...src/components/cairo/modules/language_constructs/pages/operator_precedence.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Below is the table of operator precedence. | ||
|
||
The higher an operator is in the table, the earlier it is evaluated. | ||
|
||
[cols="1,1,1",options="header"] | ||
|=== | ||
| Group | Operators | Comments | ||
| Method calls, struct member access | `.` | | ||
| Postfix unary | `?` `[]` | | ||
| Prefix unary | `@` `*` `!` `~` `-` | | ||
.4+| Bitwise | `<<` `>>` | Not yet supported. | ||
| `&` | | ||
| `^` | | ||
| `\|` | | ||
.2+| Arithmetic | `*` `/` `%` .2+| * Preceded by bitwise operators starting + | ||
from next major Cairo version (3). | ||
|
||
See https://github.com/starkware-libs/cairo/discussions/3552[discussion]. | ||
| `+` `-` | ||
| Comparison | `==` `!=` `<` `\<=` `>` `>=` | | ||
.2+| Logical | `&&` | | ||
| `\|\|` | | ||
| Assignment | `=` `+=` `-=` `*=` `/=` `%=` | ||
|
||
`<\<=` `>>=` `&=` `^=` `\|=` | Second line not yet supported. | ||
|=== |