Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
28f19140
Commit
28f19140
authored
Nov 25, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle presence of illegal semicolon after package clause better.
R=r, r1
https://golang.org/cl/157167
parent
a38ec58d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
parser.go
src/pkg/go/parser/parser.go
+8
-0
No files found.
src/pkg/go/parser/parser.go
View file @
28f19140
...
...
@@ -1977,6 +1977,14 @@ func (p *parser) parseFile() *ast.File {
doc
:=
p
.
leadComment
;
pos
:=
p
.
expect
(
token
.
PACKAGE
);
ident
:=
p
.
parseIdent
();
// Common error: semicolon after package clause.
// Accept and report it for better error synchronization.
if
p
.
tok
==
token
.
SEMICOLON
{
p
.
Error
(
p
.
pos
,
"expected declaration, found ';'"
);
p
.
next
();
}
var
decls
[]
ast
.
Decl
;
// Don't bother parsing the rest if we had errors already.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment