Updated arrow like and strongSpaces in the manual
Also added `-` to the first character table and standartized spaces there.
This commit is contained in:
parent
5a524c7238
commit
8490699224
1 changed files with 7 additions and 7 deletions
|
|
@ -15,8 +15,8 @@ Associativity
|
||||||
Binary operators whose first character is ``^`` are right-associative, all
|
Binary operators whose first character is ``^`` are right-associative, all
|
||||||
other binary operators are left-associative.
|
other binary operators are left-associative.
|
||||||
|
|
||||||
Operators ending in ``>`` but longer than a single character are
|
Operators whose the first character is either ``-`` or ``=`` and the last
|
||||||
called `arrow like`:idx:.
|
character is ``>`` are called `arrow like`:idx:.
|
||||||
|
|
||||||
|
|
||||||
Precedence
|
Precedence
|
||||||
|
|
@ -43,14 +43,14 @@ Otherwise precedence is determined by the first character.
|
||||||
Precedence level Operators First character Terminal symbol
|
Precedence level Operators First character Terminal symbol
|
||||||
================ =============================================== ================== ===============
|
================ =============================================== ================== ===============
|
||||||
10 (highest) ``$ ^`` OP10
|
10 (highest) ``$ ^`` OP10
|
||||||
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
|
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
|
||||||
8 ``+ -`` ``+ ~ |`` OP8
|
8 ``+ -`` ``+ - ~ |`` OP8
|
||||||
7 ``&`` ``&`` OP7
|
7 ``&`` ``&`` OP7
|
||||||
6 ``..`` ``.`` OP6
|
6 ``..`` ``.`` OP6
|
||||||
5 ``== <= < >= > != in notin is isnot not of`` ``= < > !`` OP5
|
5 ``== <= < >= > != in notin is isnot not of`` ``= < > !`` OP5
|
||||||
4 ``and`` OP4
|
4 ``and`` OP4
|
||||||
3 ``or xor`` OP3
|
3 ``or xor`` OP3
|
||||||
2 ``@ : ?`` OP2
|
2 ``@ : ?`` OP2
|
||||||
1 *assignment operator* (like ``+=``, ``*=``) OP1
|
1 *assignment operator* (like ``+=``, ``*=``) OP1
|
||||||
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
|
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
|
||||||
================ =============================================== ================== ===============
|
================ =============================================== ================== ===============
|
||||||
|
|
@ -67,7 +67,7 @@ is still parsed as ``1 + (3 * 4)``, but ``1+3 * 4`` is parsed as ``(1+3) * 4``:
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
#! strongSpaces
|
#! strongSpaces
|
||||||
if foo+4 * 4 == 8 and b&c | 9 ++
|
if foo+4 * 4 == 8 and b&c | 9 ++
|
||||||
bar:
|
bar:
|
||||||
echo ""
|
echo ""
|
||||||
# is parsed as
|
# is parsed as
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue