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

"export enum" with comment is pretty hard to annotate #52

Closed
evmar opened this issue Feb 9, 2016 · 1 comment
Closed

"export enum" with comment is pretty hard to annotate #52

evmar opened this issue Feb 9, 2016 · 1 comment

Comments

@evmar
Copy link
Contributor

evmar commented Feb 9, 2016

We try to emit a @typedef for enums when we hit them.
Below is the tree of the various nodes and where the emits happen when parsing something like

// comment here
export enum ...

Note that we emit the @typedef before we hit the ExportKeyword, which means it'll be hard to make the @typedef appear directly adjacent to the enum in the output. I'm beginning to think stripping comments by default is a better strategy...

| | node: EnumDeclaration
| | | emit "/** @typedef {number} */\n"
| | | node: SyntaxList
| | | | node: ExportKeyword
| | | | | emit "\n\n// This additional exported enum is here to exercise the fix for issue #51.\nexport"
| | | node: EnumKeyword
| | | | emit " enum"
@evmar
Copy link
Contributor Author

evmar commented Feb 9, 2016

It turns out that the type with the comment in the middle works, and I was confused by two other bugs! Closing.

@evmar evmar closed this as completed Feb 9, 2016
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

No branches or pull requests

1 participant