summaryrefslogtreecommitdiff
path: root/src/pkg/go/parser/parser.go
AgeCommit message (Collapse)AuthorFilesLines
2009-07-16ast:Robert Griesemer1-172/+80
- renamed Program -> SourceFile - added Package node representing the AST for an entire package - added filter function to create a source file mimicking the interface of an entire package parser: - parser entry to parse entire packages - unified naming of parser entry points - factored out entry points into new file (interface.go) gofmt: - extended to accept single .go files, and package paths: gofmt file.go // formatting of a single file gofmt -x file.go // interface of a single file gofmt -x ./MyPackage // interface of a local package gofmt -x math // interface of a $GOROOT relative package Various adjustments in dependent files, documentation. R=rsc DELTA=634 (369 added, 153 deleted, 112 changed) OCL=31743 CL=31748
2009-07-14- interface and comments cleanupRobert Griesemer1-28/+26
R=rsc DELTA=33 (1 added, 3 deleted, 29 changed) OCL=31620 CL=31642
2009-07-14- adjust to new scanner interface (pass filename to Init)Robert Griesemer1-79/+14
- delete error handling code which is not needed anymore R=rsc DELTA=83 (0 added, 65 deleted, 18 changed) OCL=31572 CL=31602
2009-07-09Show BUG comments in godoc:Robert Griesemer1-101/+100
ast.go: - rename Comments -> CommentGroup (less confusion) - change all comments/docs to be *CommentGroup filter.go: - do not remove unassociated comments from program as part of export filtering (they are needed by doc.go for BUG comments) scanner.go: - exclude '\n' from //-style comments parser.go: - rewrote collection of comments: now all collected comments are *ast.CommentGroups - clarified distinction between leading and trailing comments - fixed a bug in comment collection (parseGenDecl); corresponding test case is in printer/testdata - extra documentation doc.go: - collect BUG comments - corresponding fix for parser bug in comment collection comment.go: - simplified regex printer.go: - adjust comment printing to new representation printer_test.go, testdata/*: - enable printing of doc comments - extended tests package.html, package.txt: - added Bugs section gofmt: - enable printing of doc comments R=rsc DELTA=339 (126 added, 38 deleted, 175 changed) OCL=31403 CL=31416
2009-07-07Add entry points for parsing statements and expressions.Austin Clements1-20/+68
R=gri APPROVED=gri DELTA=73 (48 added, 0 deleted, 25 changed) OCL=31302 CL=31308
2009-07-07- ast.FilterExports: filter non-exported anonymous fieldsRobert Griesemer1-1/+1
- fixed typo in parser.go - removed test w/ syntax errors from gofmt test script R=rsc DELTA=25 (21 added, 0 deleted, 4 changed) OCL=31296 CL=31298
2009-07-02- store trailing comments after top-level declarations in astRobert Griesemer1-41/+79
- remove a test case w/ syntax errors from test suite R=rsc DELTA=104 (44 added, 5 deleted, 55 changed) OCL=31078 CL=31085
2009-06-29io.StringBytes -> strings.BytesRuss Cox1-5/+7
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-15fixed typo (slipped in with previous submit)Robert Griesemer1-1/+1
TBR=rsc OCL=30300 CL=30300
2009-06-15Support for line comments trailing a field or declaration:Robert Griesemer1-119/+186
- ast: added extra fields - parser: extended comment parsing to capture potential trailing comments Cleanups: - parser: more documentation, changed various identifiers from _-style to camelCase R=r,rsc DELTA=214 (84 added, 13 deleted, 117 changed) OCL=30259 CL=30299
2009-06-12removed bogus if-statementRobert Griesemer1-3/+0
R=iant DELTA=3 (0 added, 3 deleted, 0 changed) OCL=30251 CL=30251
2009-06-10- parser bug: return keyword may be followed by case or default keyword as wellRobert Griesemer1-2/+2
- fixed unrelated typo R=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=30175 CL=30175
2009-06-09mv src/lib to src/pkgRob Pike1-0/+1975
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102