diff --git a/parser/_instance/instance5/cmd.gop b/parser/_instance/instance5/cmd.gop new file mode 100644 index 000000000..b693b560a --- /dev/null +++ b/parser/_instance/instance5/cmd.gop @@ -0,0 +1,6 @@ +var a [2]int +if 0 < a[0] { + println a + println T[int]{1} + println (T[int]){a:1,b:2} +} diff --git a/parser/_instance/instance5/parser.expect b/parser/_instance/instance5/parser.expect new file mode 100644 index 000000000..1dc92068c --- /dev/null +++ b/parser/_instance/instance5/parser.expect @@ -0,0 +1,115 @@ +package main + +file cmd.gop +noEntrypoint +ast.GenDecl: + Tok: var + Specs: + ast.ValueSpec: + Names: + ast.Ident: + Name: a + Type: + ast.ArrayType: + Len: + ast.BasicLit: + Kind: INT + Value: 2 + Elt: + ast.Ident: + Name: int +ast.FuncDecl: + Name: + ast.Ident: + Name: main + Type: + ast.FuncType: + Params: + ast.FieldList: + Body: + ast.BlockStmt: + List: + ast.IfStmt: + Cond: + ast.BinaryExpr: + X: + ast.BasicLit: + Kind: INT + Value: 0 + Op: < + Y: + ast.IndexExpr: + X: + ast.Ident: + Name: a + Index: + ast.BasicLit: + Kind: INT + Value: 0 + Body: + ast.BlockStmt: + List: + ast.ExprStmt: + X: + ast.CallExpr: + Fun: + ast.Ident: + Name: println + Args: + ast.Ident: + Name: a + ast.ExprStmt: + X: + ast.CallExpr: + Fun: + ast.Ident: + Name: println + Args: + ast.CompositeLit: + Type: + ast.IndexExpr: + X: + ast.Ident: + Name: T + Index: + ast.Ident: + Name: int + Elts: + ast.BasicLit: + Kind: INT + Value: 1 + ast.ExprStmt: + X: + ast.CallExpr: + Fun: + ast.Ident: + Name: println + Args: + ast.CompositeLit: + Type: + ast.ParenExpr: + X: + ast.IndexExpr: + X: + ast.Ident: + Name: T + Index: + ast.Ident: + Name: int + Elts: + ast.KeyValueExpr: + Key: + ast.Ident: + Name: a + Value: + ast.BasicLit: + Kind: INT + Value: 1 + ast.KeyValueExpr: + Key: + ast.Ident: + Name: b + Value: + ast.BasicLit: + Kind: INT + Value: 2