summaryrefslogtreecommitdiff
path: root/src/pkg/go/printer/printer_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý1-0/+194
2011-09-13Imported Upstream version 60Ondřej Surý1-204/+0
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý1-3/+34
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý1-3/+3
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-1/+36
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-10/+14
2010-02-01update printer tests to use new syntaxRobert Griesemer1-11/+2
R=rsc CC=golang-dev http://codereview.appspot.com/198048
2010-01-27More steps towards tracking of identifier scopes.Robert Griesemer1-1/+1
- provide scope to parse functions; if non-nil, parser uses the scope to declare and lookup identifiers - resolve forward references where possible R=rsc CC=golang-dev http://codereview.appspot.com/194098
2009-12-151) Change default gofmt default settings forRobert Griesemer1-41/+41
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 3rd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180048
2009-12-11fix printer test for new syntaxRobert Griesemer1-2/+11
R=rsc http://codereview.appspot.com/175048
2009-12-02move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.Rob Pike1-3/+3
this breaks the dependency of package io on package bytes. R=rsc CC=golang-dev http://codereview.appspot.com/163085
2009-11-09 - replaced gofmt expression formatting algorithm withRobert Griesemer1-3/+3
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1026036
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-5/+5
R=rsc, r http://go/go-review/1025029
2009-11-05gofmt'ed parts of goRobert Griesemer1-19/+20
R=rsc http://go/go-review/1023001
2009-11-04rename testfiles from .go -> .orig so that they won't beRobert Griesemer1-8/+8
picked up by gofmt (they should not be modified) or godoc (testdata should not be considered a potential package directory) R=rsc http://go/go-review/1018045
2009-10-22Fix printer_test.go to invoke Fprint as a method of cfg.Ian Lance Taylor1-1/+1
This matches the change to printer.go in revision 3632. R=gri http://go/go-review/1015001
2009-10-22- make printer interface easily extensible w/o breaking clients (in the future)Robert Griesemer1-4/+4
- replacement for p4 CL 35999 (abandoned) R=rsc http://go/go-review/1012010
2009-10-22go/printer:Robert Griesemer1-1/+1
- handle HTML tagging via (client-installable) Stylers go/doc: - basic styler support - some factoring - ready to contain the search code (but for now excluded) doc/style.css: - updated doc/go_spec.css: - cleanup: replace deprecated uses of <font> tag with <span> tag R=rsc DELTA=302 (160 added, 62 deleted, 80 changed) OCL=35973 CL=35996
2009-10-15- bug fix: must not insert indentation tabs into multi-line strings in RawFormatRobert Griesemer1-13/+27
(always write tabwriter.Escape chars so formatting is driven correctly; but strip them again in the end if no tabwriter is used) - added testcase for RawFormat printing R=rsc DELTA=227 (198 added, 6 deleted, 23 changed) OCL=35772 CL=35774
2009-10-06change tabwidth to 8 for testsRobert Griesemer1-1/+1
R=rsc DELTA=39 (0 added, 0 deleted, 39 changed) OCL=35360 CL=35376
2009-10-02- improved handling of white space around declarations and statementsRobert Griesemer1-0/+1
- extra tests R=rsc DELTA=366 (264 added, 37 deleted, 65 changed) OCL=35299 CL=35301
2009-09-21improved spacing around if, switch, and for control clausesRobert Griesemer1-0/+1
R=r DELTA=89 (82 added, 5 deleted, 2 changed) OCL=34870 CL=34870
2009-09-17unused importsRuss Cox1-1/+0
R=r OCL=34731 CL=34731
2009-09-16rename bytes.Buffer.Data() to bytes.Buffer.Bytes()Rob Pike1-1/+1
R=rsc DELTA=152 (6 added, 0 deleted, 146 changed) OCL=34695 CL=34701
2009-09-15go/printer:Robert Griesemer1-3/+9
- printing of expressions: put spaces only where "needed" - printing of import statements: no double indentation if there are no renames - print labels on separate lines - added extra test files go/ast: - unified basic literal nodes and as a result deleted duplicated code - added initial code to track scopes (not fully used yet) replaces CL 34553 R=rsc DELTA=881 (579 added, 223 deleted, 79 changed) OCL=34623 CL=34651
2009-09-10better gofmt formatting:Robert Griesemer1-0/+1
- first cut a better line breaks in expr lists - trailing commas and semis printed where we tend to write them - fixed a couple of minor spacing issues (interface{}, chan<-, map[x]y, x: y) - removed some formatting flags from gofmt: no need to change default - removed option to reverse declaration order when printing - excluded files from test that cause trouble with idempotency test for now R=rsc DELTA=497 (364 added, 83 deleted, 50 changed) OCL=34539 CL=34544
2009-08-12convert non-low-level non-google pkg codeRuss Cox1-1/+0
to whole-package compilation. R=r OCL=33070 CL=33101
2009-07-31printer:Robert Griesemer1-6/+3
- 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-30go/ast/filter.go:Robert Griesemer1-1/+1
- 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-28Intersperse comments nicely when printing an AST.Robert Griesemer1-1/+2
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-16ast:Robert Griesemer1-8/+1
- 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-09Show BUG comments in godoc:Robert Griesemer1-1/+1
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 Griesemer1-8/+15
- 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 Griesemer1-0/+114
R=rsc DELTA=169 (168 added, 0 deleted, 1 changed) OCL=31319 CL=31321