summaryrefslogtreecommitdiff
path: root/src/pkg/go/printer/testdata
AgeCommit message (Collapse)AuthorFilesLines
2011-02-18Imported Upstream version 2011.02.15Ondřej Surý3-1/+221
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý2-2/+10
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý9-53/+590
2010-06-08go/parser: correct position of empty statement ';'Robert Griesemer1-4/+4
(caused certain files to not be idempotent under gofmt) - corrected golden files for go/printer - slightly simplified some code in nodes.go (no impact on formatting) - these changes have no impact on gofmt output of .go files under src, misc fallthrough statement considered harmful! R=rsc CC=golang-dev http://codereview.appspot.com/1593042
2010-05-21go/printer, gofmt: fix printing of labels,Robert Griesemer2-9/+34
apply gofmt to src, misc Fixes issue 752. R=rsc CC=golang-dev http://codereview.appspot.com/1240044 Committer: Robert Griesemer <gri@golang.org>
2010-05-14go/printer (gofmt): don't lose mandatory semicolonsRobert Griesemer2-0/+36
Fixes issue 779. R=r CC=golang-dev http://codereview.appspot.com/1218042
2010-04-27fix buildRobert Griesemer1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/989044
2010-04-27gofmt: fine-tune stripping of parenthesesRobert Griesemer2-44/+83
(composite literals in control clauses only need parentheses if the literals start with a type name) R=rsc CC=golang-dev http://codereview.appspot.com/962045
2010-04-27gofmt: don't strip mandatory ()'s around composite literals in control clausesRobert Griesemer2-1/+62
Fixes issue 748. R=rsc CC=golang-dev http://codereview.appspot.com/946043
2010-03-30go/printer: follow-up on CL 802043Robert Griesemer3-12/+76
- more test cases - comment fixes - minor unrelated changes as part of investigation of issue 702 R=rsc CC=golang-dev http://codereview.appspot.com/860041
2010-03-30Gofmt preserves newlines in multiline selector expressions.Risto Jaakko Saarelma3-0/+213
This is for making the fluent interface idiom usable with gofmt. R=gri CC=golang-dev http://codereview.appspot.com/802043 Committer: Robert Griesemer <gri@golang.org>
2010-03-25godoc: don't convert multi-line functions into one-liners by defaultRobert Griesemer7-27/+99
- new heuristic: if both the opening { and closing } braces are on the same line, and the function body doesn't contain comments or is other- wise too long (e.g. signature too long), it is formatted as a one-line function - related cleanups along the way - gofmt -w src misc led to no additional changes as expected R=rsc, rsc1 CC=golang-dev, ken2, r http://codereview.appspot.com/758041
2010-03-16gofmt: more consistent formatting of const/var declsRobert Griesemer4-13/+71
- gofmt -w src misc - only manually modified file: src/pkg/go/printer/nodes.go R=rsc CC=golang-dev, r http://codereview.appspot.com/606041
2010-03-12gofmt: make sure there is a newline afterRobert Griesemer4-2/+6
a /*-style comment at the end of a file Some minor cleanups/typo fixes along the way. Fixes an issue where that newline was removed after applying gofmt. R=r CC=golang-dev http://codereview.appspot.com/476043
2010-03-12go/printer: fix a couple of hidden crashes that becomeRobert Griesemer3-0/+3
visible only when enabling internal debug mode: - in rare cases expression depth can underflow - when printing a single labeled statement, indentation may underflow if not setup correctly R=rsc CC=golang-dev http://codereview.appspot.com/484041
2010-03-04gofmt: modified algorithm for alignment of multi-line composite/list entriesRobert Griesemer2-0/+48
- only manual changes are in src/pkg/go/printer/nodes.go - use a heuristic to determine "outliers" such that not entire composites are forced to align with them - improves several places that were not unligned before due too simple heuristic - unalignes some cases that contain "outliers" - gofmt -w src misc Fixes issue 644. R=rsc, r CC=golang-dev http://codereview.appspot.com/241041
2010-03-02gofmt: fix alignment of multi-line var declarationsRobert Griesemer2-1/+42
- gofmt -w src misc R=rsc, r CC=golang-dev http://codereview.appspot.com/223101
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer3-122/+146
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-25go/printer, gofmt: align comments in multi-line expression listsRobert Griesemer3-0/+45
- gofmt -w src misc - improves several lists and fixes minor degradation introduced with the fix for issue 628 - removed some dead code (stringList) R=rsc CC=golang-dev http://codereview.appspot.com/223058
2010-02-25go/printer, gofmt: correct indentation after certain /*-style commentsRobert Griesemer2-2/+12
- applied gofmt to src and misc Note: This fix improved formatting of src/pkg/math/all_test.go but leads to a degradation in src/pkg/exp/4s/xs.go. The latter happened to "work" before accidentally. Fixing the alignment in that case in general will be a separate CL. Fixes issue 628. R=rsc CC=golang-dev http://codereview.appspot.com/223054
2010-02-24go/scanner: support for complex (imaginary) constantsRobert Griesemer2-0/+84
R=rsc CC=golang-dev http://codereview.appspot.com/223044
2010-02-24go/ast: streamline representation of field listsRobert Griesemer2-0/+16
- always include position information about opening/closing parens/braces - replace uses of []*ast.Field with *ast.FieldList Fixes issue 473. R=rsc CC=golang-dev http://codereview.appspot.com/223043
2010-02-24gofmt: don't print ()'s around function-typed results (not needed anymore)Robert Griesemer2-0/+14
- add extra test cases to go/printer tests - apply gofmt to src and misc R=rsc CC=golang-dev http://codereview.appspot.com/223041
2010-02-24go/printer: use general comment intersperse mechanism everywhereRobert Griesemer3-7/+27
- remove several TODOs - as a side-effect, comment stylers are now used always and comments will be properly colored in godoc pkg documentation pages (and not only when looking at source text) R=rsc CC=golang-dev http://codereview.appspot.com/222041
2010-02-17gofmt: make sure certain 2-line comments are stableRobert Griesemer2-0/+184
under repeated application of gofmt R=agl, agl1 CC=golang-dev http://codereview.appspot.com/212046
2010-02-16Don't print ()'s around a range clause's expression.Robert Griesemer2-0/+4
Fixes issue 605. R=rsc CC=golang-dev http://codereview.appspot.com/207108
2010-02-01update printer tests to use new syntaxRobert Griesemer8-579/+464
R=rsc CC=golang-dev http://codereview.appspot.com/198048
2010-01-28support for ...T parameters (go/* packages)Robert Griesemer2-0/+48
R=rsc CC=golang-dev http://codereview.appspot.com/194126
2010-01-11Remove -oldprinter flag from gofmt; all code isRobert Griesemer7-663/+661
now printed using the semicolon-free style. Removed NoSemis flag and mechanism dealing with optional semicolons from go/printer. Updated all go/printer output files using the semi-colon free style. Changes have no formatting impact on checked in go code under src and misc. R=rsc, r CC=golang-dev http://codereview.appspot.com/184068
2010-01-11Partial work-around for gofmt bug.Robert Griesemer3-3/+82
Addresses some cases and respects position of closing parenthesis; but doesn't work yet in all cases. Heuristic; will need to be replaced by a real solution eventually. Does not cause existing code to be reformatted. R=r CC=golang-dev, rsc http://codereview.appspot.com/186043
2009-12-14improved formatting of import declarations andRobert Griesemer5-2/+82
multi-line expressions with comments Fixes issue 414. R=rsc http://codereview.appspot.com/179047
2009-12-11fix printer test for new syntaxRobert Griesemer7-103/+247
R=rsc http://codereview.appspot.com/175048
2009-11-19Permit omission of hi bound in slices.Robert Griesemer3-0/+15
R=r, rsc http://codereview.appspot.com/157082
2009-11-09 - replaced gofmt expression formatting algorithm withRobert Griesemer5-48/+264
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 Griesemer5-32/+32
R=rsc, r http://go/go-review/1025029
2009-11-06format composite literal types that are "short" struct type literalsRobert Griesemer3-0/+38
on one line for a more compact representation of some composite Literals R=rsc http://go/go-review/1025008
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer3-25/+11
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05fix a comment formatting bug:Robert Griesemer2-0/+6
- this ensures better comment formatting in template.go and codec_test.go - it affects only 2 files of all files that have been gofmt'ed already, see separate CL (it fixes the same issue in those files) R=rsc http://go/go-review/1023002
2009-11-052nd attempt: no noIndent for string listsRobert Griesemer4-19/+131
- slightly better output in general - extra indentation where we could do without (however that seems better for now that not having the indentation where it is needed) - no information is lost, so a future better approach can fix these places up again R=rsc http://go/go-review/1017050
2009-11-04more comment formatting:Robert Griesemer2-5/+123
- preserve (some) indentation of comment text for /*-style comments even if the first comment line does not contain any text that might suggest the "correct" indentation - enabled because otherwise existing larger comments get re-formatted (this will not introduce a lot of changes since comments of this kind - until now - were not changed with respect to indentation) R=rsc http://go/go-review/1016047
2009-11-04rename testfiles from .go -> .orig so that they won't beRobert Griesemer6-0/+0
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-11-04better placement of /*-style comments interspersed with code on one lineRobert Griesemer3-1/+11
R=rsc http://go/go-review/1017030
2009-11-04- always format blocks with closing } on a new line, even if emptyRobert Griesemer3-30/+60
- at the moment this also affects single-line function declarations because we have disabled them at the moment (but not single-line function literals) R=rsc http://go/go-review/1016040
2009-11-04- respect source line breaks in grouped declarationsRobert Griesemer2-0/+85
- made ast.Spec nodes implement Node interface - added extra test cases R=rsc http://go/go-review/1016038
2009-11-03- don't loose extra line breaks in struct/interface declarationsRobert Griesemer2-0/+96
- start new sections if a field/method declaration spans multiple lines; this avoids tabs from the previous line affecting the next field/method R=rsc http://go/go-review/1017015
2009-11-02- collect line comments for methods in interfacesRobert Griesemer1-3/+3
(previously not shown in godoc) - simplify parsing of struct types (match code structure for parsing interface types) R=rsc, r http://go/go-review/1016019
2009-10-30improved comment formatting:Robert Griesemer7-11/+273
- print comments line by line, strip common prefix but do not modify comment contents otherwise - align comments with subsequent keyword if indicated (e.g. case labels) - terminate "column section" after multi-line expressions for better alignment R=rsc http://go/go-review/1017002
2009-10-28fix for long label names impacting column width of previous linesRobert Griesemer2-0/+34
R=rsc http://go/go-review/1013017
2009-10-19support one-line functionsRobert Griesemer5-0/+64
R=rsc DELTA=207 (160 added, 42 deleted, 5 changed) OCL=35854 CL=35887
2009-10-15improved handling of expression listsRobert Griesemer6-24/+115
R=rsc DELTA=189 (118 added, 9 deleted, 62 changed) OCL=35816 CL=35821