From a2fe49b498955bc70c0cafc037a2ccd8b1b843d0 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 25 Jun 2018 14:02:12 -0700 Subject: [PATCH] Fixed documentation comments at the start of a file. Change-Id: Ic24018a6cd604c71b4d8d3cd35dc7a583fb18394 --- src/idl_parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 1799c6363..2be1fd933 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -266,7 +266,7 @@ bool IsIdentifierStart(char c) { CheckedError Parser::Next() { doc_comment_.clear(); - bool seen_newline = false; + bool seen_newline = cursor_ == source_; attribute_.clear(); for (;;) { char c = *cursor_++; @@ -410,7 +410,7 @@ CheckedError Parser::Next() { const char *start = ++cursor_; while (*cursor_ && *cursor_ != '\n' && *cursor_ != '\r') cursor_++; if (*start == '/') { // documentation comment - if (cursor_ != source_ && !seen_newline) + if (!seen_newline) return Error( "a documentation comment should be on a line on its own"); doc_comment_.push_back(std::string(start + 1, cursor_));