relax warning about inconsistent spacing (#10968)

Now the warning is raised only in the cases when there is an
inconsistency in the style (spacing vs no spacing):
* if a> b      --> warning
* if a >   b   --> no warning
This commit is contained in:
Miran
2019-04-05 12:37:33 +02:00
committed by Andreas Rumpf
parent 795de374fb
commit f309e4ff54

View File

@@ -266,7 +266,7 @@ proc checkBinary(p: TParser) {.inline.} =
## Check if the current parser token is a binary operator.
# we don't check '..' here as that's too annoying
if p.tok.tokType == tkOpr:
if p.tok.strongSpaceB > 0 and p.tok.strongSpaceA != p.tok.strongSpaceB:
if p.tok.strongSpaceB > 0 and p.tok.strongSpaceA == 0:
parMessage(p, warnInconsistentSpacing, prettyTok(p.tok))
#| module = stmt ^* (';' / IND{=})