* fixes #10200 * add rule for other comparison operators * add rule for '!=' * add test * fixed to pass the test
This commit is contained in:
parent
8546393ddb
commit
a990afcedc
3 changed files with 14 additions and 1 deletions
|
|
@ -247,7 +247,8 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
|
||||||
wr(TokTypeToStr[tok.tokType])
|
wr(TokTypeToStr[tok.tokType])
|
||||||
if not em.inquote: wr(" ")
|
if not em.inquote: wr(" ")
|
||||||
of tkOpr, tkDotDot:
|
of tkOpr, tkDotDot:
|
||||||
if (tok.strongSpaceA == 0 and tok.strongSpaceB == 0) or em.inquote:
|
if ((tok.strongSpaceA == 0 and tok.strongSpaceB == 0) or em.inquote) and
|
||||||
|
tok.ident.s notin ["<", ">", "<=", ">=", "==", "!="]:
|
||||||
# bug #9504: remember to not spacify a keyword:
|
# bug #9504: remember to not spacify a keyword:
|
||||||
lastTokWasTerse = true
|
lastTokWasTerse = true
|
||||||
# if not surrounded by whitespace, don't produce any whitespace either:
|
# if not surrounded by whitespace, don't produce any whitespace either:
|
||||||
|
|
|
||||||
|
|
@ -360,3 +360,9 @@ foobar
|
||||||
|
|
||||||
# bug #9673
|
# bug #9673
|
||||||
discard `* `(1, 2)
|
discard `* `(1, 2)
|
||||||
|
|
||||||
|
proc fun4() =
|
||||||
|
var a = "asdf"
|
||||||
|
var i = 0
|
||||||
|
while i<a.len and i<a.len:
|
||||||
|
return
|
||||||
|
|
|
||||||
|
|
@ -369,3 +369,9 @@ foobar
|
||||||
|
|
||||||
# bug #9673
|
# bug #9673
|
||||||
discard `*`(1, 2)
|
discard `*`(1, 2)
|
||||||
|
|
||||||
|
proc fun4() =
|
||||||
|
var a = "asdf"
|
||||||
|
var i = 0
|
||||||
|
while i < a.len and i < a.len:
|
||||||
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue