New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimpretty adds a space before type, ptr, ref, object in wrong places #9504

Closed
timotheecour opened this Issue Oct 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@timotheecour
Copy link
Collaborator

timotheecour commented Oct 25, 2018

case 1

proc fun*[T:not (tuple|object|string|cstring|char|ref|ptr|array|seq|distinct)]() =
  type T2 = a.type
  discard

nimpretty output:

proc fun*[T: not (tuple| object|string|cstring|char| ref| ptr|array|seq| distinct)]() =
  type T2 = a. type
  discard

the spaceing in tuple| object|string|cstring|char| ref| ptr|array|seq| distinct is inconsistent.
also the space in a. type is wrong

expected output: same as input

case 2

likewise, a space before not is wrongly inserted below:
doAssert isThrown(foo).not indents badly as doAssert isThrown(foo). not
Note: this sounds similar to ( not false) case mentioned here: #8078 (comment)

@Araq Araq closed this in 0afca3d Oct 25, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Oct 31, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

nimpretty: fixes #9504
(cherry picked from commit 0afca3d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment