Make a table for operator precedences

This commit is contained in:
Iavor Diatchki 2021-04-30 12:00:46 -07:00
parent 29eefbc09d
commit 7a98ab5b9b

View File

@ -116,24 +116,44 @@ The following table contains Cryptol's operators and their
associativity with lowest precedence operators first, and highest
precedence last.
Operator Associativity
----------------------------------------- -------------
`==>` right
`\/` right
`/\` right
`==` `!=` `===` `!==` not associative
`>` `<` `<=` `>=` `<$` `>$` `<=$` `>=$` not associative
`||` right
`^` left
`&&` right
`#` right
`>>` `<<` `>>>` `<<<` `>>$` left
`+` `-` left
`*` `/` `%` `/$` `%$` left
`^^` right
`@` `@@` `!` `!!` left
(unary) `-` `~` right
.. table:: Operator precedences
+-----------------------------------------+-----------------+
|Operator | Associativity |
+=========================================+=================+
| ``==>`` | right |
+-----------------------------------------+-----------------+
| ``\/`` | right |
+-----------------------------------------+-----------------+
| ``/\`` | right |
+-----------------------------------------+-----------------+
| ``==`` ``!=`` ``===`` ``!==`` | not associative |
+-----------------------------------------+-----------------+
| ``>`` ``<`` ``<=`` ``>=`` | not associative |
| ``<$`` ``>$`` ``<=$`` ``>=$`` | |
+-----------------------------------------+-----------------+
| ``||`` | right |
+-----------------------------------------+-----------------+
| ``^`` | left |
+-----------------------------------------+-----------------+
| ``&&`` | right |
+-----------------------------------------+-----------------+
| ``#`` | right |
+-----------------------------------------+-----------------+
| ``>>`` ``<<`` ``>>>`` ``<<<`` ``>>$`` | left |
+-----------------------------------------+-----------------+
| ``+`` ``-`` | left |
+-----------------------------------------+-----------------+
| ``*`` ``/`` ``%`` ``/$`` ``%$`` | left |
+-----------------------------------------+-----------------+
| ``^^`` | right |
+-----------------------------------------+-----------------+
| ``@`` ``@@`` ``!`` ``!!`` | left |
+-----------------------------------------+-----------------+
| (unary) ``-`` ``~`` | right |
+-----------------------------------------+-----------------+
Table: Operator precedences.