From f23b7e37243036724053b3f6d475c4ac9f577661 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 5 Aug 2016 20:18:13 +0200 Subject: [PATCH] removed 'strong spaces' from the manual because some people on reddit who never actually tried the feature are afraid that they could be confused (TM). Boo, we like to learn crazy precedence tables instead and check they adhere with the spacing. --- doc/manual/syntax.txt | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/doc/manual/syntax.txt b/doc/manual/syntax.txt index 74bf7e3c98..89f8ca707d 100644 --- a/doc/manual/syntax.txt +++ b/doc/manual/syntax.txt @@ -70,48 +70,6 @@ Whether an operator is used a prefix operator is also affected by preceeding whi echo($foo) -Strong spaces -------------- - -The number of spaces preceding a non-keyword operator affects precedence -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 - if foo+4 * 4 == 8 and b&c | 9 ++ - bar: - echo "" - # is parsed as - if ((foo+4)*4 == 8) and (((b&c) | 9) ++ bar): echo "" - - -Furthermore whether an operator is used a prefix operator is affected by the -number of spaces: - -.. code-block:: nim - #? strongSpaces - echo $foo - # is parsed as - echo($foo) - -This also affects whether ``[]``, ``{}``, ``()`` are parsed as constructors -or as accessors: - -.. code-block:: nim - #? strongSpaces - echo (1,2) - # is parsed as - echo((1,2)) - -Only 0, 1, 2, 4 or 8 spaces are allowed to specify precedence and it is -enforced that infix operators have the same amount of spaces before and after -them. This rules does not apply when a newline follows after the operator, -then only the preceding spaces are considered. - - Grammar -------