From f15b4ccb520b541b1bbaf2c0ae042b98bc8360cc Mon Sep 17 00:00:00 2001 From: ReneSac Date: Thu, 9 Apr 2015 17:00:11 -0300 Subject: [PATCH] Restrict arrow-like operators to start with - or = --- compiler/parser.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index f135c540c0..f195892eb4 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -212,7 +212,8 @@ proc getPrecedence(tok: TToken, strongSpaces: bool): int = let relevantChar = tok.ident.s[0] # arrow like? - if L > 1 and tok.ident.s[L-1] == '>': return considerStrongSpaces(1) + if L > 1 and tok.ident.s[L-1] == '>' and tok.ident.s[0] in {'-', '='}: + return considerStrongSpaces(1) template considerAsgn(value: expr) = result = if tok.ident.s[L-1] == '=': 1 else: value