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
e2862606
Commit
e2862606
authored
Jan 06, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix parse heuristic: make(x) must accept a type for x
R=r OCL=22171 CL=22171
parent
344b1651
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
parser.go
usr/gri/pretty/parser.go
+2
-2
No files found.
usr/gri/pretty/parser.go
View file @
e2862606
...
...
@@ -785,8 +785,8 @@ func (P *Parser) ParseCall(x0 *AST.Expr) *AST.Expr {
if
P
.
tok
!=
Scanner
.
RPAREN
{
P
.
expr_lev
++
;
var
t
*
AST
.
Type
;
if
x0
.
tok
==
Scanner
.
IDENT
&&
x0
.
s
==
"new"
{
// heuristic: assume it's a new(
*
T, ...) call, try to parse a type
if
x0
.
tok
==
Scanner
.
IDENT
&&
(
x0
.
s
==
"new"
||
x0
.
s
==
"make"
)
{
// heuristic: assume it's a new(
T) or make(
T, ...) call, try to parse a type
t
=
P
.
TryType
();
}
if
t
!=
nil
{
...
...
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