Skip to content
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 formats enums differently based on commas #11467

Closed
narimiran opened this issue Jun 10, 2019 · 0 comments

Comments

@narimiran
Copy link
Member

commented Jun 10, 2019

Running nimpretty example.nim produces different formatting based on the existence or absence of commas.

Example

type
  FirstEnum = enum ## doc comment here
    first,  ## this is first
    second, ## second doc
    third,  ## third one
    fourth  ## the last one


type
  SecondEnum = enum ## doc comment here
    first,  ## this is first
    second, ## second doc
    third,  ## third one
    fourth, ## the last one


type
  ThirdEnum = enum ## doc comment here
    first    ## this is first
    second   ## second doc
    third    ## third one
    fourth   ## the last one

Current Output

type
  FirstEnum = enum            ## doc comment here
    first, ## this is first
    second, ## second doc
    third, ## third one
    fourth                    ## the last one


type
  SecondEnum = enum           ## doc comment here
    first, ## this is first
    second, ## second doc
    third, ## third one
    fourth, ## the last one


type
  ThirdEnum = enum            ## doc comment here
    first                     ## this is first
    second                    ## second doc
    third                     ## third one
    fourth                    ## the last one

Expected Output

The same output in all three type sections, probably the same as ThirdEnum currently.

Additional Information

$ nim -v
Nim Compiler Version 0.20.0 [Linux: amd64]

@narimiran narimiran added the nimpretty label Jun 10, 2019

@Araq Araq self-assigned this Jun 13, 2019

@Araq Araq closed this in 57a83df Jun 14, 2019

narimiran added a commit to narimiran/Nim that referenced this issue Jun 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.