Restrict arrow-like operators to start with - or =
This commit is contained in:
parent
15b5f52e8c
commit
f15b4ccb52
1 changed files with 2 additions and 1 deletions
|
|
@ -212,7 +212,8 @@ proc getPrecedence(tok: TToken, strongSpaces: bool): int =
|
||||||
let relevantChar = tok.ident.s[0]
|
let relevantChar = tok.ident.s[0]
|
||||||
|
|
||||||
# arrow like?
|
# 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) =
|
template considerAsgn(value: expr) =
|
||||||
result = if tok.ident.s[L-1] == '=': 1 else: value
|
result = if tok.ident.s[L-1] == '=': 1 else: value
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue