Commit 5bd3c3b7 authored by Robert Griesemer's avatar Robert Griesemer

- support for [...] parsing and pretty printing

R=r
OCL=22185
CL=22185
parent b0f627a6
......@@ -268,7 +268,10 @@ func (P *Parser) ParseArrayType() *AST.Type {
t := AST.NewType(P.pos, 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);
}
P.Expect(Scanner.RBRACK);
......
......@@ -46,6 +46,9 @@ var (
A = 5;
u, v, w int = 0, 0, 0;
foo = "foo";
fixed_array0 = [10]int{};
fixed_array1 = [10]int{0, 1, 2};
fixed_array2 = [...]string{"foo", "bar"};
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment