aboutsummaryrefslogtreecommitdiff
path: root/docs/precedence.md
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-02-27 07:21:50 -0600
committerCody <cody@codyq.dev>2023-02-27 07:21:50 -0600
commitebfd74ddf0ef6372624ea171e06f8460d0e1351b (patch)
treed59df0e9600a6f2b86b57949048cf990a3e102ae /docs/precedence.md
parenta653a6602fe5ae5eb4739755db7b34bc92ecdadf (diff)
downloadsloth-ebfd74ddf0ef6372624ea171e06f8460d0e1351b.tar.gz
pain
Diffstat (limited to 'docs/precedence.md')
-rw-r--r--docs/precedence.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/precedence.md b/docs/precedence.md
new file mode 100644
index 0000000..417fa45
--- /dev/null
+++ b/docs/precedence.md
@@ -0,0 +1,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 |