Mercurial > projects > dil
changeset 613:7034d3f9e40c
Fixed Node.getDocComments().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 07 Jan 2008 20:43:39 +0100 |
parents | c65b11c2074c |
children | 8c5b1558244b |
files | trunk/src/dil/ast/Node.d |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/ast/Node.d Mon Jan 07 20:36:08 2008 +0100 +++ b/trunk/src/dil/ast/Node.d Mon Jan 07 20:43:39 2008 +0100 @@ -307,13 +307,8 @@ Token*[] getDocComments(bool function(Token*) isDocComment = &isDDocComment) { Token*[] comments; - // Get comment to the right. - auto token = end.next; - if (token.type == TOK.Comment && - isDocComment(token)) - comments ~= token; // Get preceding comments. - token = begin; + auto token = begin; // Scan backwards until we hit another declaration. while (1) { @@ -336,6 +331,11 @@ } } } + // Get single comment to the right. + token = end.next; + if (token.type == TOK.Comment && + isDocComment(token)) + comments ~= token; return comments; } }