fixes #2559
This commit is contained in:
parent
ffe51966b9
commit
d7a472743b
6 changed files with 26 additions and 18 deletions
|
|
@ -68,13 +68,13 @@ Strong spaces
|
|||
-------------
|
||||
|
||||
The number of spaces preceding a non-keyword operator affects precedence
|
||||
if the experimental parser directive ``#!strongSpaces`` is used. Indentation
|
||||
if the experimental parser directive ``#?strongSpaces`` is used. Indentation
|
||||
is not used to determine the number of spaces. If 2 or more operators have the
|
||||
same number of preceding spaces the precedence table applies, so ``1 + 3 * 4``
|
||||
is still parsed as ``1 + (3 * 4)``, but ``1+3 * 4`` is parsed as ``(1+3) * 4``:
|
||||
|
||||
.. code-block:: nim
|
||||
#! strongSpaces
|
||||
#? strongSpaces
|
||||
if foo+4 * 4 == 8 and b&c | 9 ++
|
||||
bar:
|
||||
echo ""
|
||||
|
|
@ -86,7 +86,7 @@ Furthermore whether an operator is used a prefix operator is affected by the
|
|||
number of spaces:
|
||||
|
||||
.. code-block:: nim
|
||||
#! strongSpaces
|
||||
#? strongSpaces
|
||||
echo $foo
|
||||
# is parsed as
|
||||
echo($foo)
|
||||
|
|
@ -95,7 +95,7 @@ This also affects whether ``[]``, ``{}``, ``()`` are parsed as constructors
|
|||
or as accessors:
|
||||
|
||||
.. code-block:: nim
|
||||
#! strongSpaces
|
||||
#? strongSpaces
|
||||
echo (1,2)
|
||||
# is parsed as
|
||||
echo((1,2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue