mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 15:22:01 +00:00
Fixed documentation comments at the start of a file.
Change-Id: Ic24018a6cd604c71b4d8d3cd35dc7a583fb18394
This commit is contained in:
@@ -266,7 +266,7 @@ bool IsIdentifierStart(char c) {
|
|||||||
|
|
||||||
CheckedError Parser::Next() {
|
CheckedError Parser::Next() {
|
||||||
doc_comment_.clear();
|
doc_comment_.clear();
|
||||||
bool seen_newline = false;
|
bool seen_newline = cursor_ == source_;
|
||||||
attribute_.clear();
|
attribute_.clear();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char c = *cursor_++;
|
char c = *cursor_++;
|
||||||
@@ -410,7 +410,7 @@ CheckedError Parser::Next() {
|
|||||||
const char *start = ++cursor_;
|
const char *start = ++cursor_;
|
||||||
while (*cursor_ && *cursor_ != '\n' && *cursor_ != '\r') cursor_++;
|
while (*cursor_ && *cursor_ != '\n' && *cursor_ != '\r') cursor_++;
|
||||||
if (*start == '/') { // documentation comment
|
if (*start == '/') { // documentation comment
|
||||||
if (cursor_ != source_ && !seen_newline)
|
if (!seen_newline)
|
||||||
return Error(
|
return Error(
|
||||||
"a documentation comment should be on a line on its own");
|
"a documentation comment should be on a line on its own");
|
||||||
doc_comment_.push_back(std::string(start + 1, cursor_));
|
doc_comment_.push_back(std::string(start + 1, cursor_));
|
||||||
|
|||||||
Reference in New Issue
Block a user