Skip to content

Commit d2aeb27

Browse files
authored
Merge pull request #14735 from rintaro/4.1-ast-comment-endline
[4.1][AST] Retrive EndLine after StartLineAndColumn for SingleRawComment
2 parents 44a7aa5 + 4cf9035 commit d2aeb27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/AST/RawComment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct SingleRawComment {
3232
unsigned Kind : 8;
3333
unsigned StartColumn : 16;
3434
unsigned StartLine;
35-
const unsigned EndLine;
35+
unsigned EndLine;
3636

3737
SingleRawComment(CharSourceRange Range, const SourceManager &SourceMgr);
3838
SingleRawComment(StringRef RawText, unsigned StartColumn);

lib/AST/RawComment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ static SingleRawComment::CommentKind getCommentKind(StringRef Comment) {
5757
SingleRawComment::SingleRawComment(CharSourceRange Range,
5858
const SourceManager &SourceMgr)
5959
: Range(Range), RawText(SourceMgr.extractText(Range)),
60-
Kind(static_cast<unsigned>(getCommentKind(RawText))),
61-
EndLine(SourceMgr.getLineNumber(Range.getEnd())) {
60+
Kind(static_cast<unsigned>(getCommentKind(RawText))) {
6261
auto StartLineAndColumn = SourceMgr.getLineAndColumn(Range.getStart());
6362
StartLine = StartLineAndColumn.first;
6463
StartColumn = StartLineAndColumn.second;
64+
EndLine = SourceMgr.getLineNumber(Range.getEnd());
6565
}
6666

6767
SingleRawComment::SingleRawComment(StringRef RawText, unsigned StartColumn)

0 commit comments

Comments
 (0)