mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 10:54:42 +00:00
@@ -559,7 +559,7 @@ following characters::
|
||||
defined here.)
|
||||
|
||||
These keywords are also operators:
|
||||
``and or not xor shl shr div mod in notin is isnot of``.
|
||||
``and or not xor shl shr div mod in notin is isnot of as``.
|
||||
|
||||
`.`:tok: `=`:tok:, `:`:tok:, `::`:tok: are not available as general operators; they
|
||||
are used for other notational purposes.
|
||||
@@ -632,21 +632,21 @@ has the second lowest precedence.
|
||||
|
||||
Otherwise precedence is determined by the first character.
|
||||
|
||||
================ =============================================== ================== ===============
|
||||
Precedence level Operators First character Terminal symbol
|
||||
================ =============================================== ================== ===============
|
||||
10 (highest) ``$ ^`` OP10
|
||||
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
|
||||
8 ``+ -`` ``+ - ~ |`` OP8
|
||||
7 ``&`` ``&`` OP7
|
||||
6 ``..`` ``.`` OP6
|
||||
5 ``== <= < >= > != in notin is isnot not of`` ``= < > !`` OP5
|
||||
4 ``and`` OP4
|
||||
3 ``or xor`` OP3
|
||||
2 ``@ : ?`` OP2
|
||||
1 *assignment operator* (like ``+=``, ``*=``) OP1
|
||||
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
|
||||
================ =============================================== ================== ===============
|
||||
================ ================================================== ================== ===============
|
||||
Precedence level Operators First character Terminal symbol
|
||||
================ ================================================== ================== ===============
|
||||
10 (highest) ``$ ^`` OP10
|
||||
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
|
||||
8 ``+ -`` ``+ - ~ |`` OP8
|
||||
7 ``&`` ``&`` OP7
|
||||
6 ``..`` ``.`` OP6
|
||||
5 ``== <= < >= > != in notin is isnot not of as`` ``= < > !`` OP5
|
||||
4 ``and`` OP4
|
||||
3 ``or xor`` OP3
|
||||
2 ``@ : ?`` OP2
|
||||
1 *assignment operator* (like ``+=``, ``*=``) OP1
|
||||
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
|
||||
================ ================================================== ================== ===============
|
||||
|
||||
|
||||
Whether an operator is used a prefix operator is also affected by preceding
|
||||
|
||||
Reference in New Issue
Block a user