Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Issue 8769044: Added code to associate a dart doc comment with a dart declaration node. (Closed)

Created:
9 years ago by devoncarew
Modified:
9 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added code to associate a dart doc comment with a dart declaration node. Committed: https://code.google.com/p/dart/source/detail?r=2090

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -1 line) Patch
M compiler/java/com/google/dart/compiler/ast/DartDeclaration.java View 1 2 2 chunks +11 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java View 1 2 2 chunks +94 lines, -0 lines 4 comments Download
M compiler/javatests/com/google/dart/compiler/parser/CommentTest.java View 1 2 3 3 chunks +25 lines, -0 lines 0 comments Download
A compiler/javatests/com/google/dart/compiler/parser/Comments2.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
devoncarew
Miguel/John: we're looking to plumb dartdoc support through from the compiler to the UI. We'd ...
9 years ago (2011-12-02 18:06:14 UTC) #1
Brian Wilkerson
LGTM
9 years ago (2011-12-02 18:25:33 UTC) #2
codefu
On 2011/12/02 18:06:14, devoncarew wrote: > Miguel/John: we're looking to plumb dartdoc support through from ...
9 years ago (2011-12-02 18:27:39 UTC) #3
Brian Wilkerson
> Curious why you didn't overload some of the parser methods handling declarations > to ...
9 years ago (2011-12-02 19:06:12 UTC) #4
devoncarew
> Curious why you didn't overload some of the parser methods handling declarations > to ...
9 years ago (2011-12-02 19:07:21 UTC) #5
devoncarew
> wrong and shouldn't be that hard. I rescind my LG. Nooo!
9 years ago (2011-12-02 19:07:50 UTC) #6
codefu
On 2011/12/02 19:06:12, Brian Wilkerson wrote: > > Curious why you didn't overload some of ...
9 years ago (2011-12-02 19:22:36 UTC) #7
Brian Wilkerson
> ... then I double checked and noticed comments are > generated _after_ the parsing ...
9 years ago (2011-12-02 19:30:36 UTC) #8
devoncarew
PTAL, I added a guard against dartdocs contained in sibling nodes, and added a test ...
9 years ago (2011-12-05 09:17:28 UTC) #9
Brian Wilkerson
LGTM http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java File compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java (right): http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java#newcode154 compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java:154: public DartNode visitNode(DartNode node) { We could improve ...
9 years ago (2011-12-05 16:14:24 UTC) #10
mmendez
lgtm http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java File compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java (right): http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java#newcode208 compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java:208: private List<DartNode> getChildren(DartNode parent) { Nit: You are ...
9 years ago (2011-12-05 17:58:49 UTC) #11
devoncarew
9 years ago (2011-12-05 19:30:38 UTC) #12
http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java
(right):

http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java:154:
public DartNode visitNode(DartNode node) {
On 2011/12/05 16:14:24, Brian Wilkerson wrote:
> We could improve the performance by overriding
visitDeclaration(DartDeclaration)
> rather than visitNode(DartNode).

Done.

http://codereview.chromium.org/8769044/diff/9005/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java:208:
private List<DartNode> getChildren(DartNode parent) {
On 2011/12/05 17:58:50, mmendez wrote:
> Nit: You are probably redoing a lot of work here when dealing with methods
> declared on a class or when there are a lot of top level classes.  Perhaps a
> range sort might be better.

Good catch - it looks like we are unnecessarily re-doing calculations. From
thinking about it, I think I prefer the simplicity of this method to the added
complexity of caching the child information for the nodes. It's fairly
light-weight to re-calculate. Unless I hear objections, I'll submit this CL as
is -

Powered by Google App Engine
This is Rietveld 408576698