1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:47:56 -07:00
go/usr/gri/pretty/selftest1.go
Robert Griesemer 3689e221e8 Steps towards a general scanner/parser library for Go:
- converted more of AST and parser to use interfaces and explicit
structs for individual Go constructs (can be replaced now with
interface calls such that the parser becomes AST structure
independent, as suggested by rsc)
- added more tests (find all .go files under GOROOT)
- (temporarily) lost html links for identifiers when generating
html output
- TODO: lots of cleanups

R=r
OCL=25518
CL=25518
2009-02-27 15:40:17 -08:00

41 lines
793 B
Go

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import P0 /* ERROR expected */ ; /* SYNC */
import P1 /* ERROR expected */ Flags /* SYNC */
import P2 /* ERROR expected */ 42 /* SYNC */
type S0 struct {
f0, f1, f2 int;
}
func /* ERROR receiver */ () f0() {} /* SYNC */
func /* ERROR receiver */ (*S0, *S0) f1() {} /* SYNC */
func f0(a b, c /* ERROR type */ ) /* SYNC */ {}
func f1() {
}
func CompositeLiterals() {
a1 := []int();
a2 := []int(0, 1, 2, );
a3 := []int(0, 1, 2, /* ERROR single value expected */ 3 : 4, 5); /* SYNC */
a1 := []int(0 : 1, 2 : 3, /* ERROR key:value pair expected */ 4, ); /* SYNC */
}
func main () {
}
func /* ERROR EOF */