OSDN Git Service

Insert semicolon at EOF if necessary.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 2010 18:52:09 +0000 (18:52 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 2010 18:52:09 +0000 (18:52 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167809 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/lex.cc

index bc2531e..ad1a1fe 100644 (file)
@@ -542,7 +542,13 @@ Lex::next_token()
   while (true)
     {
       if (!this->require_line())
-       return this->make_eof_token();
+       {
+         bool add_semi_at_eol = this->add_semi_at_eol_;
+         this->add_semi_at_eol_ = false;
+         if (add_semi_at_eol)
+           return this->make_operator(OPERATOR_SEMICOLON, 1);
+         return this->make_eof_token();
+       }
 
       const char* p = this->linebuf_ + this->lineoff_;
       const char* pend = this->linebuf_ + this->linesize_;