Skip to content
Snippets Groups Projects
Commit 04278772 authored by Pascal Perez's avatar Pascal Perez Committed by CQ bot account: commit-bot@chromium.org
Browse files

[fidlfmt] Fix comment line sniffing

For comments with no content, i.e. "<opt-space>//" we were incorrectly
treating them as non-comment lines.

Test: added

FIDL-613 #done

Change-Id: I7e877658b567f612d01698acfde132bc4196aaab
parent c886af41
No related branches found
No related tags found
No related merge requests found
......@@ -261,7 +261,11 @@ private:
// doc comments, which start with three slashes, should not
// be treated as comments since they get internally converted
// to attributes
return (i < static_cast<int>(str.size()) - 2) && str[i + 2] != '/';
if (str.size() == 2) {
return true;
} else {
return str[i + 2] != '/';
}
} else {
return false;
}
......
......@@ -167,6 +167,11 @@ Before();
;
// Some multiline
//
// comment with blank lines
struct Hi{};
// Comments at EOF
......@@ -163,4 +163,10 @@ protocol POfMany
-> After();
};
// Some multiline
//
// comment with blank lines
struct Hi {
};
// Comments at EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment