summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-08 13:37:22 +0100
committerAraq <rumpf_a@web.de>2015-02-08 13:38:06 +0100
commitc91ca82a43917163f00cf86e59d80a8909dca80a (patch)
treea1c90a80134dd1eabe2b71089e121601cec62abc
parent52e297c4e186ad3c28583a5fd8a2a782cee1aed3 (diff)
downloadNim-c91ca82a43917163f00cf86e59d80a8909dca80a.tar.gz
fixes #2073; language spec change: arrow like operators are not right associative anymore
-rw-r--r--compiler/parser.nim4
-rw-r--r--doc/manual/syntax.txt6
-rw-r--r--web/news.txt1
3 files changed, 5 insertions, 6 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index aae0ce7f9..f249b37c8 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -198,8 +198,8 @@ proc isSigilLike(tok: TToken): bool {.inline.} =
 
 proc isRightAssociative(tok: TToken): bool {.inline.} =
   ## Determines whether the token is right assocative.
-  result = tok.tokType == tkOpr and (tok.ident.s[0] == '^' or
-    (let L = tok.ident.s.len; L > 1 and tok.ident.s[L-1] == '>'))
+  result = tok.tokType == tkOpr and tok.ident.s[0] == '^'
+  # or (let L = tok.ident.s.len; L > 1 and tok.ident.s[L-1] == '>'))
 
 proc getPrecedence(tok: TToken, strongSpaces: bool): int =
   ## Calculates the precedence of the given token.
diff --git a/doc/manual/syntax.txt b/doc/manual/syntax.txt
index c975e7f48..b40a8ce91 100644
--- a/doc/manual/syntax.txt
+++ b/doc/manual/syntax.txt
@@ -12,10 +12,8 @@ Binary operators have 11 different levels of precedence.
 Associativity
 -------------
 
-Binary operators whose first character is ``^`` or its last character
-is ``>`` are right-associative, all other binary operators are left-associative.
-
-Exception: The single "greater than" ``>`` operator is left-associative too.
+Binary operators whose first character is ``^`` are right-associative, all
+other binary operators are left-associative.
 
 Operators ending in ``>`` but longer than a single character are 
 called `arrow like`:idx:.
diff --git a/web/news.txt b/web/news.txt
index ac7971f20..f765479a2 100644
--- a/web/news.txt
+++ b/web/news.txt
@@ -20,6 +20,7 @@ News
     ``addHandler``, ``getHandlers``, ``setLogFilter`` and ``getLogFilter``
     should be used instead.
   - ``nim idetools`` has been replaced by a separate tool `nimsuggest`_.
+  - *arrow like* operators are not right associative anymore.
 
   
   Language Additions