Community
Participate
Working Groups
When an AST is built by AST.parse*(...), the entire source string is parsed. Except for the Javadoc comments, the positions of all the other comments are unavailable from the resulting AST. This is unfortunate, and causes clients that wishing to determine the location of comments to re-scan the source.
For M7, we have made the following changes to the DOM/AST API: - added CompilationUnit.getCommentTable() to record locations of all comments found in the source - added 2 new node types, LineComment and BlockComment, to represent end-of- line and traditional comments respectively - these new nodes are placeholders for comments - these new node types only occur in the comment table (since they can occur anywhere (lexically), there is no way to properly parent them in the regular AST nodes that reflects their position) - AST.parse*(...) now returns sets the comment table on the compilation unit to include all comments (including attached and free-floating doc comments)
Reopen to assign the bug to me.
Test cases need to be completed...
Verified for 3.0M7