summaryrefslogtreecommitdiff
path: root/src/cmd/gofmt
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý13-0/+1202
2011-09-13Imported Upstream version 60Ondřej Surý13-1223/+0
2011-08-03Imported Upstream version 59upstream/59Ondřej Surý2-3/+3
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý2-15/+11
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý10-24/+122
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý8-173/+230
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý2-3/+3
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý2-6/+7
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-2/+2
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý9-33/+408
2010-07-01strings and bytes.Split: make count of 0 mean 0, not infinite.Rob Pike1-1/+1
Use a count of -1 for infinity. Ditto for Replace. R=rsc CC=golang-dev http://codereview.appspot.com/1704044 Committer: Rob Pike <r@golang.org>
2010-06-09go/scanner: report illegal escape sequencesRobert Griesemer1-1/+1
R=golang-dev, r CC=golang-dev http://codereview.appspot.com/1636043
2010-06-08gofmt: update test script so it can run to completion againRobert Griesemer1-1/+2
R=rsc CC=golang-dev http://codereview.appspot.com/1621041
2010-05-14gofmt: exclude test w/ illegal syntax from test casesRobert Griesemer1-1/+1
R=adg CC=golang-dev http://codereview.appspot.com/1228041
2010-04-09rename os.Dir to os.FileInfoRob Pike1-5/+5
R=rsc CC=golang-dev http://codereview.appspot.com/902042
2010-03-15gofmt: fix for gofmt rewrite featureRobert Griesemer2-5/+15
Fixes issue 643. R=rsc CC=golang-dev http://codereview.appspot.com/576041
2010-02-19- removed exp/parser (support for old semicolon syntax)Robert Griesemer2-21/+5
- go/ast: removed StringList (not needed anymore) - go/ast: changed import path and field list tag to a single string - updated all dependencies R=rsc CC=golang-dev http://codereview.appspot.com/217056
2010-02-12update gofmt test scriptRobert Griesemer1-4/+9
R=adg CC=golang-dev http://codereview.appspot.com/207088
2010-01-27More steps towards tracking of identifier scopes.Robert Griesemer2-6/+7
- 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
2010-01-26Allow func() func().Robert Griesemer1-1/+1
Update gofmt test script. R=rsc CC=golang-dev http://codereview.appspot.com/195044
2010-01-15 Steps towards tracking scopes for identifiers.Robert Griesemer2-2/+6
- Identifiers refer now to the language entity (Object) that they denote. At the moment this is at best an approximation. - Initial data structures for language entities (Objects) and expression types (Type) independent of the actual type notations. - Initial support for declaring and looking up identifiers. - Updated various dependent files and added support functions. - Extensively tested to avoid breakage. This is an AST change. R=rsc CC=golang-dev, rog http://codereview.appspot.com/189080
2010-01-12Fix bug that prevented the gofmt test script being run on moreRoger Peppe1-2/+2
than one explicitly named file. R=rsc, gri CC=golang-dev http://codereview.appspot.com/186095 Committer: Robert Griesemer <gri@golang.org>
2010-01-11Remove -oldprinter flag from gofmt; all code isRobert Griesemer1-5/+1
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
2009-12-21update test.sh so it can run to completion againRobert Griesemer1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/179120
2009-12-17fix for gofmt rewrite matcher bugRobert Griesemer1-0/+3
R=rsc CC=golang-dev http://codereview.appspot.com/179096
2009-12-16- Parse expressions as opposed to statements for gofmt rewrite patterns.Robert Griesemer1-11/+8
Allows stand-alone types (e.g. []int as patterns) and doesn't require a semicolon at the end (which are now mandatory terminators). - Fix a matcher bug. R=rsc CC=golang-dev http://codereview.appspot.com/179088
2009-12-15 1) Change default gofmt default settings forRobert Griesemer2-124/+124
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 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
2009-12-11Various cleanups:Robert Griesemer1-1/+1
- no need to replace comments for stand-alone blocks - always print string concatenations with interspersed "+" (remove option) - minor cleanups R=rsc http://codereview.appspot.com/174076
2009-12-10- make make test working againRobert Griesemer1-15/+15
- some factoring for easier experimentation R=rsc http://codereview.appspot.com/174048
2009-12-10New flags for gofmt:Robert Griesemer2-10/+31
- oldparser parse old syntax (required semicolons) - oldprinter print old syntax (required semicolons) By default, these flags are enabled for now. Setting -oldparser=false has no effect until go/parser is changed to accept the new syntax. Enabled exp/parser in Makefile; update dependent exp/eval. R=rsc http://codereview.appspot.com/174051
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-12-02updated documentation for gofmtRobert Griesemer1-0/+2
R=rsc http://codereview.appspot.com/164085
2009-12-02Add flag -tabindent to gofmt: forces use ofRobert Griesemer1-13/+21
tabs for indentation even if -spaces is set. Changes to gofmt: - added -tabindent flag - don't recompute parser and printer mode repeatedly Changes to go/printer: - provide new printing mode TabIndent Changes to tabwriter: - implement new mode TabIndent to use tabs independent of the actual padding character for leading empty columns - distinguish between minimal cell width and tab width (tabwidth is only used if the output contains tabs, minwidth and padding are always considered) - fixed and added more comments - some additional factoring By default, -tabindent is disabled and the default gofmt behavior is unchanged. By setting -spaces and -tabindent, gofmt will use tabs for indentation but do any other alignment with spaces. This permits a user to change the visible indentation by simply changing the editor's tab width and the code will remain properly aligned without the need to rerun gofmt. R=rsc http://codereview.appspot.com/163068
2009-12-02gofmt: race condition in error reporting and setting exit codeFazlul Shahriar1-1/+4
How to reproduce: $ mkdir /tmp/foo $ cp /dev/null /tmp/foo/bar.go $ chmod -r /tmp/foo/bar.go $ gofmt /tmp/foo open /tmp/foo/bar.go: permission denied $ echo $? # should echo 2 0 $ Maybe you need to put a call to time.Sleep at the beginning of report(). R=gri CC=golang-dev http://codereview.appspot.com/164073 Committer: Robert Griesemer <gri@golang.org>
2009-12-01FreeBSD needs #!/usr/bin/env bash (fixes broken build on FreeBSD)Devon H. O'Dell1-1/+1
R=gri http://codereview.appspot.com/163067 Committer: Robert Griesemer <gri@golang.org>
2009-12-01make test.sh work againRobert Griesemer1-5/+6
R=rsc http://codereview.appspot.com/164059
2009-12-01gofmt: use os.Stdin instead of opening /dev/stdinFazlul Shahriar1-8/+18
Opening /dev/stdin can sometimes fail. For example, in the acme editor, executing "Edit ,|gofmt" fails with: open /dev/stdin: no such device or address Executing "Edit ,|ls -l /dev/stdin /proc/self/fd/0" gives: lrwxrwxrwx 1 root root 15 2009-09-07 02:17 /dev/stdin -> /proc/self/fd/0 lrwx------ 1 fhs users 64 2009-11-26 22:05 /proc/self/fd/0 -> socket:[5528230] (This is my first change, and I've signed the individual contributor license agreement.) R=rsc, gri CC=golang-dev http://codereview.appspot.com/162041 Committer: Robert Griesemer <gri@golang.org>
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia2-17/+17
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-23gofmt -r: documentation and minor fixesRuss Cox2-16/+44
fix a few paren insertion bugs in the printer too. R=gri, r CC=golang-dev http://codereview.appspot.com/157119
2009-11-20gofmt: add -r flag to rewrite source code according to patternRuss Cox3-2/+239
a little slow, but usable (speed unchanged when not using -r) tweak go/printer to handle nodes without line numbers more gracefully in a couple cases. R=gri http://codereview.appspot.com/156103
2009-11-19update test.sh for gofmtRobert Griesemer1-6/+3
R=rsc http://codereview.appspot.com/157096
2009-11-14Build changes to support work on the BSDs.Devon H. O'Dell1-1/+1
This does still contain some FreeBSD-specific bits, but it's a pain to do partial diffs. R=rsc http://codereview.appspot.com/152138 Committer: Russ Cox <rsc@golang.org>
2009-11-12Remove -align flag from gofmt.Robert Griesemer2-6/+0
(Making it work correctly with -spaces is a bit of work and the output won't make much sense as it is intended as input to tabwriter.) Fixes issue 100. R=rsc http://codereview.appspot.com/154102
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-18/+18
R=rsc, r http://go/go-review/1025029
2009-11-09tweak documentation of commandsRuss Cox1-1/+1
so that first sentence is better for cmd page. live at http://r45:3456/cmd/ R=gri, r http://go/go-review/1024034
2009-11-07- avoid division-by-zero crash in tabwriterRobert Griesemer1-0/+4
- correct tabwidth argument for some tabwriter test cases - catch negative tabwidth flag in gofmt w/o crashing R=rsc http://go/go-review/1026022
2009-11-04document godoc and gofmtRob Pike1-0/+38
R=rsc http://go/go-review/1018036
2009-11-01enable all (but one) test cases in test.sh thatRobert Griesemer1-15/+11
were excluded before because of incorrect comment formatting (comment formatting is mostly idempotent at this point) R=rsc http://go/go-review/1018014
2009-10-22- make printer interface easily extensible w/o breaking clients (in the future)Robert Griesemer1-1/+1
- 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