nimpretty: fixes more reported issues
This commit is contained in:
parent
26568dff00
commit
0725003a8c
3 changed files with 10 additions and 3 deletions
|
|
@ -169,7 +169,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
|
||||||
of tokKeywordLow..tokKeywordHigh:
|
of tokKeywordLow..tokKeywordHigh:
|
||||||
if endsInAlpha(em):
|
if endsInAlpha(em):
|
||||||
wr(" ")
|
wr(" ")
|
||||||
elif not em.inquote and not endsInWhite(em):
|
elif not em.inquote and not endsInWhite(em) and tok.tokType in oprSet:
|
||||||
wr(" ")
|
wr(" ")
|
||||||
|
|
||||||
if not em.inquote:
|
if not em.inquote:
|
||||||
|
|
@ -207,9 +207,9 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
|
||||||
tkColonColon, tkDot:
|
tkColonColon, tkDot:
|
||||||
wr(TokTypeToStr[tok.tokType])
|
wr(TokTypeToStr[tok.tokType])
|
||||||
of tkEquals:
|
of tkEquals:
|
||||||
if not em.endsInWhite: wr(" ")
|
if not em.inquote and not em.endsInWhite: wr(" ")
|
||||||
wr(TokTypeToStr[tok.tokType])
|
wr(TokTypeToStr[tok.tokType])
|
||||||
wr(" ")
|
if not em.inquote: wr(" ")
|
||||||
of tkOpr, tkDotDot:
|
of tkOpr, tkDotDot:
|
||||||
if tok.strongSpaceA == 0 and tok.strongSpaceB == 0:
|
if tok.strongSpaceA == 0 and tok.strongSpaceB == 0:
|
||||||
# if not surrounded by whitespace, don't produce any whitespace either:
|
# if not surrounded by whitespace, don't produce any whitespace either:
|
||||||
|
|
@ -224,6 +224,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
|
||||||
wr(" ")
|
wr(" ")
|
||||||
rememberSplit(splitBinary)
|
rememberSplit(splitBinary)
|
||||||
of tkAccent:
|
of tkAccent:
|
||||||
|
if not em.inquote and endsInAlpha(em): wr(" ")
|
||||||
wr(TokTypeToStr[tok.tokType])
|
wr(TokTypeToStr[tok.tokType])
|
||||||
em.inquote = not em.inquote
|
em.inquote = not em.inquote
|
||||||
of tkComment:
|
of tkComment:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ discard """
|
||||||
|
|
||||||
import verylongnamehere,verylongnamehere,verylongnamehereverylongnamehereverylong,namehere,verylongnamehere
|
import verylongnamehere,verylongnamehere,verylongnamehereverylongnamehereverylong,namehere,verylongnamehere
|
||||||
|
|
||||||
|
proc `[]=`() = discard "index setter"
|
||||||
|
proc `putter=`() = discard cast[pointer](cast[int](buffer) + size)
|
||||||
|
|
||||||
type
|
type
|
||||||
GeneralTokenizer* = object of RootObj ## comment here
|
GeneralTokenizer* = object of RootObj ## comment here
|
||||||
kind*: TokenClass ## and here
|
kind*: TokenClass ## and here
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ discard """
|
||||||
import verylongnamehere, verylongnamehere,
|
import verylongnamehere, verylongnamehere,
|
||||||
verylongnamehereverylongnamehereverylong, namehere, verylongnamehere
|
verylongnamehereverylongnamehereverylong, namehere, verylongnamehere
|
||||||
|
|
||||||
|
proc `[]=`() = discard "index setter"
|
||||||
|
proc `putter=`() = discard cast[pointer](cast[int](buffer) + size)
|
||||||
|
|
||||||
type
|
type
|
||||||
GeneralTokenizer* = object of RootObj ## comment here
|
GeneralTokenizer* = object of RootObj ## comment here
|
||||||
kind*: TokenClass ## and here
|
kind*: TokenClass ## and here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue