Commit Graph

314 Commits

Author SHA1 Message Date
Robert Griesemer
7ff2536633 - make godoc restart feature work properly
R=rsc
DELTA=11  (10 added, 0 deleted, 1 changed)
OCL=29007
CL=29009
2009-05-18 16:26:34 -07:00
Robert Griesemer
1ed725d7cd - changed parser to return os.Error, removed ErrorHandler
- added IsValid predicate to token.Position
- updated pretty, godoc, gobuild
- updated/expanded test cases

R=rsc
DELTA=265  (97 added, 78 deleted, 90 changed)
OCL=28961
CL=29005
2009-05-18 14:59:16 -07:00
Robert Griesemer
e8c1e2b93a get rid of unused files in my home dir
TBR=r
DELTA=9270  (0 added, 9270 deleted, 0 changed)
OCL=28958
CL=28958
2009-05-15 19:15:45 -07:00
Robert Griesemer
b7585a31b7 weekly snapshot:
format.go:
- better error handling, indentation, support for defaults,
  environments for custom formatters, cleanups (more functionality, less code)

pretty.go:
- better comment printing using format.go

made test script more robust

TBR=r
DELTA=622  (175 added, 305 deleted, 142 changed)
OCL=28956
CL=28956
2009-05-15 18:52:59 -07:00
Robert Griesemer
8ee8fdea3c restart functionality
R=rsc
DELTA=21  (19 added, 0 deleted, 2 changed)
OCL=28938
CL=28941
2009-05-15 15:45:35 -07:00
Robert Griesemer
05851636f3 godoc fix: relative paths were incorrect
R=r
DELTA=13  (1 added, 6 deleted, 6 changed)
OCL=28840
CL=28844
2009-05-14 14:59:51 -07:00
Robert Griesemer
f3b08744a2 Simplified AST:
- one node for array and slice types
- one node for index and slice expressions
- simplified parser, astprinter, and ast.txt

R=r
DELTA=71  (0 added, 43 deleted, 28 changed)
OCL=28768
CL=28768
2009-05-13 15:18:05 -07:00
David Symonds
6c384d2268 Allow http.Redirect to do both temporary (307) and permanent (301) redirects.
This also adds a missing 'return' when a malformed URL is passed to it.

R=rsc
APPROVED=rsc
DELTA=30  (13 added, 2 deleted, 15 changed)
OCL=28598
CL=28710
2009-05-12 15:41:19 -07:00
Robert Griesemer
c6da3e5a69 A couple of godoc improvements:
- sort directories before printing
- apply filtering to factory functions and methods
- remove a couple of unused files

R=r
DELTA=84  (34 added, 40 deleted, 10 changed)
OCL=28657
CL=28657
2009-05-11 16:52:59 -07:00
Robert Griesemer
5a11a46e2d weekly snapshot
- godoc updated to work w/new directory structure

TBR=r
OCL=28624
CL=28624
2009-05-11 09:47:53 -07:00
Russ Cox
917aa35f8f implications of stricter type equality:
if both types are named, they must be
the same type (arising from the same
declaration).

R=r,gri
DELTA=44  (21 added, 4 deleted, 19 changed)
OCL=28436
CL=28577
2009-05-08 15:40:14 -07:00
Russ Cox
918afd9491 move things out of sys into os and runtime
R=r
OCL=28569
CL=28573
2009-05-08 15:21:41 -07:00
Rob Pike
01712ae7d3 embeddability: change bufio.BufRead to bufio.Reader etc.
R=rsc
DELTA=112  (0 added, 4 deleted, 108 changed)
OCL=28537
CL=28543
2009-05-08 11:52:39 -07:00
Rob Pike
c8b47c6fce Name change to improve embeddability:
io.Read->io.Reader
	io.Write,Close,etc.->io.Writer,Closer etc.

R=rsc
DELTA=190  (0 added, 0 deleted, 190 changed)
OCL=28525
CL=28535
2009-05-08 11:22:57 -07:00
Russ Cox
63629d5307 minor cleanup, not required by compiler changes
R=r
DELTA=14  (1 added, 4 deleted, 9 changed)
OCL=28447
CL=28509
2009-05-08 10:14:55 -07:00
Robert Griesemer
d76f095750 semi-weekly snapshot:
- format-driven pretty printing now handles all of Go code
- better error handling

R=r
OCL=28370
CL=28372
2009-05-06 16:28:18 -07:00
Robert Griesemer
19c239c9af - remove wrong fix
(this corresponds to the currently running version of godoc)

R=r
DELTA=11  (0 added, 10 deleted, 1 changed)
OCL=28238
CL=28238
2009-05-04 15:04:32 -07:00
Robert Griesemer
0d6a5f417f weekly snapshot:
- template-driven ast printing now can successfully
  reproduce entire Go programs

next steps:
- fine-tuning of output
- print interspersed comments
- cleanup and testing against all Go programs
- replace astprinter

R=r
OCL=28181
CL=28181
2009-05-01 19:32:41 -07:00
Robert Griesemer
22301e8cea Some adjustments to godoc:
- work-around for incorrect import path
- added tmpl root in order to run against a goroot w/o templates
- clarifications

Daily snapshot of syntax-driven formatter. Some progress.

Updated gccgo Makefile.

TBR=r
OCL=28004
CL=28004
2009-04-28 19:11:37 -07:00
Robert Griesemer
bf53e16f6d - install doc in lib/go
- adjust dependent files

R=rsc
DELTA=1132  (567 added, 562 deleted, 3 changed)
OCL=27862
CL=27862
2009-04-25 17:01:41 -07:00
Robert Griesemer
9b6009b651 - minor formatting and capitalization (export) changes
TBR=rsc
OCL=27861
CL=27861
2009-04-25 16:52:30 -07:00
Robert Griesemer
af8036aa6b - renamed docprinter.go -> doc.go
- adjusted dependent files
  (no changes in doc.go)

TBR=rsc
OCL=27860
CL=27860
2009-04-25 16:48:00 -07:00
Robert Griesemer
f8ff3b1055 daily snapshot:
- more work on template-driven ast formatting
- added preliminary test suite
- added documentation

TBR=r
OCL=27858
CL=27858
2009-04-25 16:36:17 -07:00
Robert Griesemer
3aa892c4f9 daily snapshot:
- more work on template-driven ast printing

R=r
OCL=27851
CL=27851
2009-04-24 17:22:58 -07:00
Robert Griesemer
448a7b46a9 daily snapshot:
- minor bug fixes in pretty, godoc
- first cut at template-driven printing of ast

TBR=r
OCL=27825
CL=27825
2009-04-23 21:53:01 -07:00
Rob Pike
9d70646fcf allow godoc to match on regular expressions.
if the name contains a metacharacter, use regexp matching;
otherwise require strict equality.

now
	godoc flag '.*Var'
can give you all the FooVar functions.

R=gri
DELTA=19  (19 added, 0 deleted, 0 changed)
OCL=27711
CL=27713
2009-04-21 22:46:19 -07:00
Rob Pike
4b62e8d7ef fix template.
.or works in .repeated so remove the comment.
the bug was in the template: .section executes iff the field is non-empty.

R=gri
DELTA=13  (6 added, 7 deleted, 0 changed)
OCL=27710
CL=27712
2009-04-21 22:26:08 -07:00
Robert Griesemer
dc08ad4f37 remove lots of accumulated crud:
- delete utility files which contained functionality that is now elsewhere
  (or saved the files away for now)
- cleanup Makefile (remove unnecessary deps)
- minor adjustments to godoc, fixed a couple of bugs
- make pretty.go self-contained

TBR=r
DELTA=625  (81 added, 510 deleted, 34 changed)
OCL=27700
CL=27702
2009-04-21 18:37:48 -07:00
David Symonds
8e4b65d041 Move iterable package to usr/dsymonds/.
R=r
APPROVED=r
DELTA=598  (330 added, 266 deleted, 2 changed)
OCL=27627
CL=27649
2009-04-20 18:13:14 -07:00
Rob Pike
7e1cfa7432 Readn is a silly name when there's no n. Change to FullRead.
R=gri
DELTA=15  (0 added, 0 deleted, 15 changed)
OCL=27619
CL=27619
2009-04-19 21:02:29 -07:00
Rob Pike
aaf63f8d06 Step 1 of the Big Error Shift: make os.Error an interface and replace *os.Errors with os.Errors.
lib/template updated to use new setup; its clients also updated.

Step 2 will make os's error support internally much cleaner.

R=rsc
OCL=27586
CL=27586
2009-04-17 00:08:24 -07:00
Russ Cox
1f6463f823 Convert go tree to hierarchical pkg directory:
import (
		"vector" -> "container/vector"
		"ast" -> "go/ast"
		"sha1" -> "hash/sha1"
		etc.
	)

and update Makefiles.  Because I did the conversion
semi-automatically, I sorted all the import blocks
as a post-processing.  Some files have therefore
changed that didn't strictly need to.

Rename local packages to lower case.
The upper/lower distinction doesn't work on OS X
and complicates the "single-package directories
with the same package name as directory name"
heuristic used by gobuild and godoc to create
the correlation between source and binary locations.
Now that we have a plan to avoid globally unique
names, the upper/lower is unnecessary.

The renamings will cause trouble for a few users,
but so will the change in import paths.
This way, the two maintenance fixes are rolled into
one inconvenience.

R=r
OCL=27573
CL=27575
2009-04-16 20:52:37 -07:00
Russ Cox
60ce95d7a1 code changes for array conversion.
as a reminder, the old conversion
was that you could write

	var arr [10]byte;
	var slice []byte;
	slice = arr;

but now you have to write

	slice = &arr;

the change eliminates an implicit &, so that
the only implicit &s left are in the . operator
and in string(arr).

also, removed utf8.EncodeRuneToString
in favor of string(rune).

R=r
DELTA=83  (1 added, 23 deleted, 59 changed)
OCL=27531
CL=27534
2009-04-15 20:27:45 -07:00
Russ Cox
1605176e25 godoc: use data-driven templates for html, text generation
R=gri
DELTA=1341  (668 added, 282 deleted, 391 changed)
OCL=27485
CL=27526
2009-04-15 18:53:43 -07:00
Russ Cox
457b0030f7 godoc: supporting data
R=gri
DELTA=252  (240 added, 3 deleted, 9 changed)
OCL=27482
CL=27521
2009-04-15 18:38:37 -07:00
Rob Pike
ff12f2effd add (stub) parser to template code, enabling rewrite.
update pretty to use it.
change stdout to stderr in pretty.

R=rsc
DELTA=173  (52 added, 24 deleted, 97 changed)
OCL=27405
CL=27409
2009-04-14 00:06:49 -07:00
Russ Cox
3d0e4741eb godoc: switch to go library template system
R=gri
DELTA=272  (38 added, 139 deleted, 95 changed)
OCL=27372
CL=27390
2009-04-13 15:25:50 -07:00
Russ Cox
e97121a187 working checkpoint.
add comment describing new web server tree.
make room for command line interface.
use new path package to get rid of doubled slashes.
use new Chdir function to avoid goroot + everything.

implement new /pkg/ tree instead of using regexps.

R=gri
DELTA=267  (103 added, 72 deleted, 92 changed)
OCL=27150
CL=27367
2009-04-13 13:28:53 -07:00
Robert Griesemer
2a9f1ee215 Daily snapshot.
- godoc now supports the following url prefixes:
  /doc/ for package documentation
  /file/ for files (directories, html, and .go files)
  /spec for the spec
  /mem for the memory model
- formatting of comments has been fixed
- tons of minor cleanups (still more to do)

Still missing:
- pretty printing of source is not as pretty as it used to be
(still a relict from the massive AST cleanup which has't quite made it's way everywhere)
- documentation entries should be sorted
- comments in code is not printed or not properly printed

TBR=r
DELTA=416  (182 added, 100 deleted, 134 changed)
OCL=27078
CL=27078
2009-04-03 16:19:22 -07:00
Robert Griesemer
bfea141ca8 - don't show methods of non-exported types
(even if the methods are exported)

R=rsc
OCL=27056
CL=27056
2009-04-02 22:39:52 -07:00
Robert Griesemer
184c623e6b - renamed hasPostfix -> hasSuffix
- fixed printing of function literals (require separating ";")

R=rsc
OCL=27055
CL=27055
2009-04-02 22:24:52 -07:00
Robert Griesemer
91238c5bfe - moved functions before types in doc output (per rsc)
- use /src and /doc prefix in URL to distinguish output type (per rsc)
- fixed a bug in an internal string function
- ignore files ending in _test.go (consider them test files)

R=rsc
OCL=27054
CL=27054
2009-04-02 21:59:37 -07:00
Robert Griesemer
9ef3d8e2e7 Daily snapshot:
first round of cleanups:
- removed extra .html templates (reduced to one)
- removed dependencies on various local files
- minor fixes throughout

Basic docserver is now operational: Automatically finds all
(multi-file) packages under a root and serves either file
or package documentation.

R=r
OCL=27049
CL=27049
2009-04-02 18:25:18 -07:00
Robert Griesemer
695c90daa0 - adjustments for changed AST
- renamed gds -> godoc
- functionality to find and serve packages
  (to get a list of packages provide dir path + "?p")

Next steps: cleanups, better formatting, fine-tuning of output

R=r
OCL=27037
CL=27039
2009-04-02 15:58:58 -07:00
Robert Griesemer
2d543d0c14 Adjustements related to AST changes.
R=r
OCL=27026
CL=27028
2009-04-02 10:16:17 -07:00
Robert Griesemer
6d5bba5148 More gds functionality:
- package headers
- constants
- variables
- formatted comments

Next steps:
- sorted output
- collection of all files belonging to a package
- fine-tuning of output

R=r
OCL=26997
CL=26997
2009-04-01 15:00:22 -07:00
Russ Cox
a9c1a3b620 change smoketest from parser.go to astprinter.go,
the largest remaining source file in this directory.

TBR=gri
OCL=26984
CL=26984
2009-04-01 03:32:44 -07:00
Robert Griesemer
78f7063d9d - also associate factory methods to a type in documentation
R=r
OCL=26974
CL=26976
2009-03-31 18:46:21 -07:00
Robert Griesemer
8f628f4955 daily snapshot:
- adjustments to match new ast/parser interface
- removed printer.go; functionality now in astprinter.go and docprinter.go
  (more cleanups pending)
- enabled new doc printing in gds
  (lots of fine tuning missing, but pieces falling into place; e.g. methods
  associated with types. Consts, Vars, to come. Collection of all files
  belonging to a package to come)

R=r
OCL=26970
CL=26972
2009-03-31 16:53:58 -07:00
Robert Griesemer
3f42f44227 - incorporation of suggestions by rsc
R=rsc
OCL=26959
CL=26959
2009-03-31 13:28:01 -07:00