summaryrefslogtreecommitdiff
path: root/src/pkg/go
AgeCommit message (Collapse)AuthorFilesLines
2009-07-31printer:Robert Griesemer2-46/+109
- prepare for generation of HTML id tags and links - do HTML-escaping in central print routine - move tabwriter setup into printer - fixed various TODOs godoc: - removed tabwriter setup, need for various HTML-escaping R=rsc DELTA=210 (107 added, 36 deleted, 67 changed) OCL=32612 CL=32616
2009-07-30- don't call String method of AST nodes when converting them to textRobert Griesemer1-7/+9
- make token.Position.String more robust TBR=rsc DELTA=20 (10 added, 6 deleted, 4 changed) OCL=32564 CL=32564
2009-07-30go/ast/filter.go:Robert Griesemer3-48/+87
- more orthogonal functionality of filter functions for better re-use go/doc/doc.go: - simplified interface - collect filenames of packages so that they can be shown godoc: - removed TODO, show list of package (linked) files used to create documentation R=rsc DELTA=130 (68 added, 24 deleted, 38 changed) OCL=32549 CL=32552
2009-07-30String method for token.Position. Extracted from gri's tree.Austin Clements2-11/+25
R=gri APPROVED=gri DELTA=33 (20 added, 6 deleted, 7 changed) OCL=32544 CL=32546
2009-07-29parser:Robert Griesemer3-36/+73
- Changed filter function for parser.ParsePackage to take an *os.Dir instead of a filename for more powerful filters - Removed TODO in ast.PackageInterface: Now collect package comments from all package files - Cleanups in godoc: Use the new ParsePackage and PackageInterface functions; as a result computing package information is much simpler now. R=rsc DELTA=285 (80 added, 110 deleted, 95 changed) OCL=32473 CL=32486
2009-07-29break tabwriter columns when starting a new block of indented statementsRobert Griesemer3-1/+16
R=r DELTA=16 (15 added, 0 deleted, 1 changed) OCL=32475 CL=32481
2009-07-28Intersperse comments nicely when printing an AST.Robert Griesemer9-181/+346
gofmt formatted source code looks pretty good already; with a bit more fine-tuning it should be great. printer.go: - Implemented comment intersperse algorithm. The approach is a result of many trial-and-error experiments but at this point reasonably simple and open to arbitrary fine-tuning. parser.go: - Simplified handling of lead and line comments (formerly called leading and trailing comments). - Use a comments list instead of an array (I may change this back - this is not obviously better and uses more space). doc.go: - Remove comments from AST nodes that have been 'consumed' in the documentation to avoid duplicate printing of them. Allows for better control of what is printed w/o use of printing control flags (which are hard to use and not fine-grained enough). Corresponding adjustments to various clients of these files. R=rsc DELTA=478 (275 added, 108 deleted, 95 changed) OCL=32185 CL=32380
2009-07-24If we can't parse the package, call Fatalf so that the testIan Lance Taylor1-1/+1
fails without crashing. R=gri DELTA=1 (0 added, 0 deleted, 1 changed) OCL=32164 CL=32171
2009-07-20Fix typo. MUL_ASSIGN is "*=", not "+=".Austin Clements1-1/+1
R=gri APPROVED=gri DELTA=1 (0 added, 0 deleted, 1 changed) OCL=31879 CL=31886
2009-07-17Produce friendlier errors messages for malformed characterAustin Clements1-7/+21
literals and when the parser hits an unexpected EOF. Also, disallow newlines in character literals. R=gri APPROVED=gri DELTA=23 (15 added, 1 deleted, 7 changed) OCL=31790 CL=31797
2009-07-16ast:Robert Griesemer9-219/+386
- 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-15- do not collect BUG comments w/o bug descriptionRobert Griesemer1-9/+17
R=rsc DELTA=17 (8 added, 0 deleted, 9 changed) OCL=31670 CL=31674
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 token.Position definitionRobert Griesemer1-1/+1
R=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=31574 CL=31604
2009-07-14- adjust to new scanner interface (pass filename to Init)Robert Griesemer2-82/+17
- 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-14- added Filename field to token.PositionRobert Griesemer5-40/+366
- handle //line filename:line comments in scanner - moved error handling code used by various scanner clients to errors.go - added extra tests R=rsc DELTA=385 (343 added, 18 deleted, 24 changed) OCL=31551 CL=31601
2009-07-13- handle type forward declarations correctlyRobert Griesemer1-2/+8
R=r DELTA=8 (6 added, 0 deleted, 2 changed) OCL=31537 CL=31537
2009-07-10fix error messagesRobert Griesemer1-2/+2
R=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=31449 CL=31451
2009-07-09fix to scanner_test after change to //-style comment tokenRobert Griesemer1-0/+5
R=rsc OCL=31421 CL=31421
2009-07-09Show BUG comments in godoc:Robert Griesemer11-182/+255
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-08- update functionality for printer testRobert Griesemer5-33/+40
- moved test files from data to testdata - use tabs instead of spaces for layout R=rsc DELTA=129 (67 added, 60 deleted, 2 changed) OCL=31353 CL=31360
2009-07-07printer_test: first cutRobert Griesemer5-1/+170
R=rsc DELTA=169 (168 added, 0 deleted, 1 changed) OCL=31319 CL=31321
2009-07-07- print comments associated with declarationsRobert Griesemer1-20/+44
- fix a bug w/ optional semicolons R=rsc DELTA=46 (24 added, 0 deleted, 22 changed) OCL=31306 CL=31311
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 Griesemer2-3/+24
- 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-07go/printer: use new reflect interface (CL 31107)Russ Cox1-2/+2
R=gri DELTA=2 (0 added, 0 deleted, 2 changed) OCL=31115 CL=31285
2009-07-06- bug fix: do not strip lower-case parameter and result names in signaturesRobert Griesemer1-5/+41
- display: show '...' if a struct/interface has fields/methods removed; show struct/interface w/o {}'s if all fields/methods were removed; and show the {}'s if the struct/interface was empty to begin with R=rsc DELTA=41 (36 added, 0 deleted, 5 changed) OCL=31201 CL=31204
2009-07-06- ast.FilterExports: strips all non-exported nodes from an ASTRobert Griesemer4-230/+232
- use FilterExports instead of the various predicates in printer.go and doc.go which simplifies a lot of code and makes it easier to deal with complex cases R=rsc DELTA=445 (197 added, 190 deleted, 58 changed) OCL=31110 CL=31196
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 Cox4-18/+21
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-24Change strings.Split, bytes.Split to take a maximum substring count argument.David Symonds1-1/+1
R=rsc APPROVED=r DELTA=131 (39 added, 10 deleted, 82 changed) OCL=30669 CL=30723
2009-06-18`` strings may span multiple linesRobert Griesemer2-1/+3
R=rsc DELTA=3 (2 added, 0 deleted, 1 changed) OCL=30511 CL=30513
2009-06-16fix nesting level for parametersRobert Griesemer1-3/+5
R=rsc DELTA=8 (4 added, 2 deleted, 2 changed) OCL=30365 CL=30368
2009-06-16- some fine-tuning of godoc templates per r's suggestionRobert Griesemer1-1/+2
- removed gratuitous newline in go/printer R=r DELTA=15 (2 added, 13 deleted, 0 changed) OCL=30358 CL=30358
2009-06-15gofmt (final resting place TBD):Robert Griesemer4-132/+1080
- replacement for pretty; app to format a single .go file printer.go (pkg/go/printer): - replacement for astprinter.go; implements AST printing - also replaces pkg/go/ast/format.go for now cleanups: - removed/saved away old code R=r,rsc,iant DELTA=2833 (1183 added, 1628 deleted, 22 changed) OCL=30226 CL=30306
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 Griesemer2-122/+193
- 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 Pike14-0/+5174
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102