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
5bd3c3b7
Commit
5bd3c3b7
authored
Jan 07, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- support for [...] parsing and pretty printing
R=r OCL=22185 CL=22185
parent
b0f627a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
parser.go
usr/gri/pretty/parser.go
+4
-1
selftest2.go
usr/gri/pretty/selftest2.go
+3
-0
No files found.
usr/gri/pretty/parser.go
View file @
5bd3c3b7
...
@@ -268,7 +268,10 @@ func (P *Parser) ParseArrayType() *AST.Type {
...
@@ -268,7 +268,10 @@ func (P *Parser) ParseArrayType() *AST.Type {
t
:=
AST
.
NewType
(
P
.
pos
,
Scanner
.
LBRACK
);
t
:=
AST
.
NewType
(
P
.
pos
,
Scanner
.
LBRACK
);
P
.
Expect
(
Scanner
.
LBRACK
);
P
.
Expect
(
Scanner
.
LBRACK
);
if
P
.
tok
!=
Scanner
.
RBRACK
{
if
P
.
tok
==
Scanner
.
ELLIPSIS
{
t
.
expr
=
P
.
NewExpr
(
P
.
pos
,
Scanner
.
ELLIPSIS
,
nil
,
nil
);
P
.
Next
();
}
else
if
P
.
tok
!=
Scanner
.
RBRACK
{
t
.
expr
=
P
.
ParseExpression
(
1
);
t
.
expr
=
P
.
ParseExpression
(
1
);
}
}
P
.
Expect
(
Scanner
.
RBRACK
);
P
.
Expect
(
Scanner
.
RBRACK
);
...
...
usr/gri/pretty/selftest2.go
View file @
5bd3c3b7
...
@@ -46,6 +46,9 @@ var (
...
@@ -46,6 +46,9 @@ var (
A
=
5
;
A
=
5
;
u
,
v
,
w
int
=
0
,
0
,
0
;
u
,
v
,
w
int
=
0
,
0
,
0
;
foo
=
"foo"
;
foo
=
"foo"
;
fixed_array0
=
[
10
]
int
{};
fixed_array1
=
[
10
]
int
{
0
,
1
,
2
};
fixed_array2
=
[
...
]
string
{
"foo"
,
"bar"
};
)
)
...
...
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