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
f3e0f214
Commit
f3e0f214
authored
Nov 29, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct expression level for argument lists.
Fixes #352. R=rsc
https://golang.org/cl/161073
parent
b5358e06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
parser.go
src/pkg/go/parser/parser.go
+2
-0
parser_test.go
src/pkg/go/parser/parser_test.go
+1
-0
No files found.
src/pkg/go/parser/parser.go
View file @
f3e0f214
...
...
@@ -992,10 +992,12 @@ func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
}
lparen
:=
p
.
expect
(
token
.
LPAREN
);
p
.
exprLev
++
;
var
args
[]
ast
.
Expr
;
if
p
.
tok
!=
token
.
RPAREN
{
args
=
p
.
parseExprList
()
}
p
.
exprLev
--
;
rparen
:=
p
.
expect
(
token
.
RPAREN
);
return
&
ast
.
CallExpr
{
fun
,
lparen
,
args
,
rparen
};
...
...
src/pkg/go/parser/parser_test.go
View file @
f3e0f214
...
...
@@ -31,6 +31,7 @@ func TestParseIllegalInputs(t *testing.T) {
var
validPrograms
=
[]
interface
{}{
`package main`
,
`package main import "fmt" func main() { fmt.Println("Hello, World!") }`
,
`package main func main() { if f(T{}) {} }`
,
}
...
...
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