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

Support for parenthesized type declarations #102

Closed
rlankfo opened this issue Jul 24, 2020 · 4 comments · Fixed by #107
Closed

Support for parenthesized type declarations #102

rlankfo opened this issue Jul 24, 2020 · 4 comments · Fixed by #107

Comments

@rlankfo
Copy link

rlankfo commented Jul 24, 2020

I had several parenthesized interface type declarations and noticed they weren't showing up in the puml output.

Examples)
Works:

type Foo interface {
  Foo()
}
type Bar interface {
  Bar()
}

Not working:

type (
  Foo interface {
    Foo()
  }
  Bar interface {
    Bar()
  }
)
@jfeliu007
Copy link
Owner

I'll take a look at this. Thanks for reporting it.

@rlankfo
Copy link
Author

rlankfo commented Sep 14, 2020

Thanks. If you could provide some direction I wouldn't mind taking a crack at a PR.

@jfeliu007
Copy link
Owner

Actually I would have to see how the AST represents this specific problem. Let me make a couple of tests to see if I can suggest a COA. Thanks for this and sorry for the delays in my responses. I think I have to hook some notifications in this repo. I only see these updates if I come to github.

@jfeliu007
Copy link
Owner

I just took a look at this. In the fileparser/class_parser.go near to line 320 the code assumes the dec.Specs array will only contain 1 element. I have never seen the declarations as you posted in this issue and of course never ran into this case. If you wrap the code from 321 to 370 around a for loop range on each Spec you will solve this issue. :)

jfeliu007 added a commit that referenced this issue Jan 6, 2021
Wrapped code to parse types inside a loop instead of just doing the first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants