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
638233a7
Commit
638233a7
authored
Oct 08, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- don't allow empty decl lists (e.g. const ())
R=r OCL=16698 CL=16698
parent
44dffd92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
parser.go
usr/gri/pretty/parser.go
+5
-7
No files found.
usr/gri/pretty/parser.go
View file @
638233a7
...
...
@@ -373,16 +373,10 @@ func (P *Parser) ParseResult() *AST.List {
func
(
P
*
Parser
)
ParseFunctionType
()
*
AST
.
FunctionType
{
P
.
Trace
(
"FunctionType"
);
P
.
OpenScope
();
P
.
level
--
;
typ
:=
new
(
AST
.
FunctionType
);
typ
.
pos
=
P
.
pos
;
typ
.
params
=
P
.
ParseParameters
();
typ
.
result
=
P
.
ParseResult
();
P
.
level
++
;
P
.
CloseScope
();
P
.
Ecart
();
return
typ
;
...
...
@@ -1341,6 +1335,8 @@ func (P *Parser) ParseDecl(exported bool, keyword int) *AST.Declaration {
P
.
Expect
(
keyword
);
if
P
.
tok
==
Scanner
.
LPAREN
{
P
.
Next
();
decl
.
decls
.
Add
(
P
.
ParseSpec
(
exported
,
keyword
));
P
.
OptSemicolon
(
Scanner
.
RPAREN
);
for
P
.
tok
!=
Scanner
.
RPAREN
{
decl
.
decls
.
Add
(
P
.
ParseSpec
(
exported
,
keyword
));
P
.
OptSemicolon
(
Scanner
.
RPAREN
);
...
...
@@ -1418,7 +1414,9 @@ func (P *Parser) ParseExportDecl() {
}
for
P
.
tok
==
Scanner
.
IDENT
{
ident
:=
P
.
ParseIdent
();
P
.
Optional
(
Scanner
.
COMMA
);
// TODO this seems wrong
if
P
.
tok
==
Scanner
.
COMMA
{
P
.
Next
();
// TODO this seems wrong
}
}
if
has_paren
{
P
.
Expect
(
Scanner
.
RPAREN
)
...
...
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