summary refs log tree commit diff stats
path: root/nimpretty
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-03 16:18:09 +0800
committerGitHub <noreply@github.com>2022-11-03 09:18:09 +0100
commit0b1d1b7886396d943a54843c63e4dc0604db0cdb (patch)
treef354c418781ab48ac0f94c616f470f0be8aabc7a /nimpretty
parentc4e5dab4197ce57af03c5eaa6117b738279fa537 (diff)
downloadNim-0b1d1b7886396d943a54843c63e4dc0604db0cdb.tar.gz
fixes #15688; handle `strongSpace` overflow issues (#20724)
* fixes #15688; handle `strongSpace` overflow issues

* stop at 1

* change the type of strongSpaceA to bool
Diffstat (limited to 'nimpretty')
-rw-r--r--nimpretty/tests/exhaustive.nim2
-rw-r--r--nimpretty/tests/expected/exhaustive.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim
index 30cfc47a9..80bf8b346 100644
--- a/nimpretty/tests/exhaustive.nim
+++ b/nimpretty/tests/exhaustive.nim
@@ -267,7 +267,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
     if not em.endsInWhite: wr(" ")
     wr(tok.ident.s)
     template isUnary(tok): bool =
-      tok.strongSpaceB == 0 and tok.strongSpaceA > 0
+      tok.strongSpaceB == 0 and tok.strongSpaceA
 
     if not isUnary(tok) or em.lastTok in {tkOpr, tkDotDot}:
       wr(" ")
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim
index 82927a11c..22bc22a7d 100644
--- a/nimpretty/tests/expected/exhaustive.nim
+++ b/nimpretty/tests/expected/exhaustive.nim
@@ -272,7 +272,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
     if not em.endsInWhite: wr(" ")
     wr(tok.ident.s)
     template isUnary(tok): bool =
-      tok.strongSpaceB == 0 and tok.strongSpaceA > 0
+      tok.strongSpaceB == 0 and tok.strongSpaceA
 
     if not isUnary(tok) or em.lastTok in {tkOpr, tkDotDot}:
       wr(" ")