- 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
so that == on func means that the
functions originated in the same
execution of a func literal or definition.
before, there was an inconsistency:
func() {x++} != func() {x++}
but
func() {} == func() {}
this CL makes the second case != too,
just like
make(map[int]int) != make(map[int]int)
R=r
DELTA=202 (71 added, 62 deleted, 69 changed)
OCL=32393
CL=32398
easier and faster to read. they are now either a one-byte value or a n-byte value
preceded by a byte holding -n.
R=rsc
DELTA=150 (45 added, 7 deleted, 98 changed)
OCL=32381
CL=32387
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
- Provides analogous functionality to a doubly-linked list
implementation.
- Completely symmetric set of operations.
- Operations on the ADT do not lead to results that are
outside the domain of the ADT (closed interface).
- Alternative to container/list.
R=rsc
DELTA=489 (489 added, 0 deleted, 0 changed)
OCL=32284
CL=32323
saving of sp was too far away from use in scanstack;
the stack had changed since the sp was saved.
R=r
DELTA=9 (4 added, 2 deleted, 3 changed)
OCL=32232
CL=32237
if there is a goroutine waiting to run
and the init goroutine enters a system call,
entersyscall was trying to kick off a new
scheduler for the other goroutine, causing
a panic (new goroutines can't run until main.main).
R=r
DELTA=32 (32 added, 0 deleted, 0 changed)
OCL=31982
CL=31982
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
introduce NodeList* type in compiler to replace OLIST.
this clarifies where lists can and cannot occur.
list append and concatenation are now cheap.
the _r rules are gone from yacc.
rev and unrev are gone.
no more lists of lists.
the representation of assignments is a bit clunkier.
split into OAS (1=1) and OAS2 (2 or more on one side).
delete dead chanrecv3 code.
delay construction of func types.
R=ken
OCL=31745
CL=31762
- 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
than io.Readers and io.Writers.
change the Encoder/Decoder protocol so that each message is preceded by its length in bytes.
R=rsc
DELTA=468 (119 added, 23 deleted, 326 changed)
OCL=31700
CL=31702
1) terminate outstanding calls on the client when we see EOF from server
2) allow data to drain on server before closing the connection
R=rsc
DELTA=41 (23 added, 4 deleted, 14 changed)
OCL=31687
CL=31689
1. use CONNECT instead of GET.
CONNECT has exactly the meaning
we want; most of the time people
connect to ip:port; we're connecting
to /_goRPC_
2. wait for a successful HTTP response
before assuming we are connected to
the RPC protocol. this allows better
error reporting and also keeps the
protocol alternating between speakers,
so that the buffering in the HTTP request
reader cannot accidentally eat some
RPC bytes too.
gotest sometimes hangs, but not in HTTP.
gotest -match=Unknown hangs every few runs
even in a clean client.
R=r
DELTA=117 (57 added, 44 deleted, 16 changed)
OCL=31656
CL=31685
- 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
runtime package for use by debugger,
which needs to make sure that all ptrace calls
about a given pid come from the same thread.
R=r
DELTA=175 (90 added, 63 deleted, 22 changed)
OCL=31546
CL=31558
server side only; no client help yet (but it's easy).
no http yet.
service is synchronous.
all this will improve.
R=rsc
DELTA=403 (403 added, 0 deleted, 0 changed)
OCL=31522
CL=31536
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
change Type to gobType.
fix some bugs around recursive structures.
lots of cleanup.
add the first cut at a type encoder.
R=rsc
DELTA=400 (287 added, 11 deleted, 102 changed)
OCL=31401
CL=31406
- rename untar{,_test}.go to reader{,_test}.go.
- fix up some comments.
- improve test output if it fails.
R=rsc
APPROVED=rsc
DELTA=821 (400 added, 392 deleted, 29 changed)
OCL=31376
CL=31378
tests to use new reflect interface.
also make tests a real gotest.
depends on CL 31107
R=r
DELTA=582 (56 added, 194 deleted, 332 changed)
OCL=31108
CL=31279
s.output.Data() was being retrieved before the synchronization
point, which meant that it could be retrieved before the
goroutine wrote it. Using gccgo this caused random errors.
R=gri
DELTA=2 (1 added, 0 deleted, 1 changed)
OCL=31046
CL=31267
Natural, Integer, and Rational numbers
- added Value() methods to access small Natural and Integers
as uint64 or int64 respectively, and to get the components
of Rational numbers
- fixed a bug with Integer creation
- removed some _'s from names
- added more comments in places
- added test cases
R=rsc
DELTA=184 (127 added, 11 deleted, 46 changed)
OCL=31210
CL=31265
* use structs instead of interfaces
* compiler lays out data structures ahead of time,
so no more parsing of strings.
* unified reflect data structures with interface
runtime data structures.
* richer data structures should enable reflection
on chans and maps, but not implemented here.
R=r,iant
DELTA=1179 (1179 added, 0 deleted, 0 changed)
OCL=31107
CL=31213
- 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
- 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
fix a bug in delta encoding: only update the delta-base if something is marshaled.
R=rsc
DELTA=154 (94 added, 56 deleted, 4 changed)
OCL=31069
CL=31071
if there is an error, we will write one more value into the struct but in return
we do fewer tests in the decode.
R=rsc
DELTA=56 (0 added, 42 deleted, 14 changed)
OCL=31041
CL=31044
now that cgo2c can handle it,
merge x.c and x_go.cgo into
a single x.cgo, for x=float,malloc,sema.
R=r
DELTA=1950 (954 added, 996 deleted, 0 changed)
OCL=30951
CL=30964
align the output args separately from the input args,
change cgo2c to insert the necessary padding
when the two arg lists are concatenated in the c
translation.
for example, there is a runtime
func indexstring(s string, i int32) (b byte)
right now in 6g those arguments are aligned in one
struct with s at offset 0, i at 16, and b at 20.
soon the b byte will be in its own struct and structs
are 8 aligned, so it will be b at 24.
right now cgo2c generates:
void indexstring(string s, int32 i, byte b)
this CL makes it generate, in --6g mode:
void indexstring(string s, int32 i, uint32, byte b)
this is valid 6c input, although not valid gcc input.
(the code is being generated for 6c only anyway.)
also, allow C code to be mixed in among the Go funcs.
every instance of the token `func' is expected to start
a new go func.
R=iant
DELTA=145 (118 added, 0 deleted, 27 changed)
OCL=30949
CL=30963
echo back context of call in error if likely to be useful.
For example, if os.Open("/etc/passwd", os.O_RDONLY)
fails with syscall.EPERM, it returns as the os.Error
&PathError{
Op: "open",
Path: "/etc/passwd"
Error: os.EPERM
}
which formats as
open /etc/passwd: permission denied
Not converted:
datafmt
go/...
google/...
regexp
tabwriter
template
R=r
DELTA=1153 (561 added, 156 deleted, 436 changed)
OCL=30738
CL=30781
because Url.Path already starts with one.
Avoid crashing in Request.ParseForm if there is no body.
R=rsc
APPROVED=rsc
DELTA=5 (4 added, 0 deleted, 1 changed)
OCL=30552
CL=30607
remove io.ErrEOF.
rename io.FullRead to io.ReadFull, to match
ReadAtLeast and ReadAll.
remove io.FullReader, because it is now unused.
R=r
DELTA=295 (88 added, 105 deleted, 102 changed)
OCL=30544
CL=30588
in a cell makes a final cell in that line
(this showed up as occasionally missing single spaces in
godoc-formatted declarations that fit on a single line)
2) Cleaned up tabwriter implementation a bit:
- replaced local unicodeLen() with utf8.RuneCount()
- instead of having 2 parallel arrays for line widths and sizes,
have a single array of cells containing a width and size
- factored code a bit better
- added more comments
- added testnames to tabwriter tests
- added more test cases and fixed a broken test case that
now works correctly
R=r
DELTA=279 (133 added, 62 deleted, 84 changed)
OCL=30509
CL=30514
* keep coherent SP/PC in gobuf
(i.e., SP that would be in use at that PC)
* gogocall replaces setspgoto,
should work better in presence of link registers
* delete unused system calls
only amd64; 386 is now broken
R=r
DELTA=548 (183 added, 183 deleted, 182 changed)
OCL=30381
CL=30442
* use 64-bit file system calls (Linux, Darwin)
* use 32-bit [sic] uid/gid calls (Linux)
* fix sockets on Linux
Darwin/386 works again.
Linux/386 is better but must never have worked;
there are still bugs surrounding the creation of new
threads in the runtime package.
R=austin
DELTA=1332 (673 added, 614 deleted, 45 changed)
OCL=30327
CL=30380
not [a-zA-Z0-9+-.]) before there is a ":".
This is particularly helpful in the erroneous-but-relatively-common
case of relative URLs containing an unescaped colon in the query
string--see the added test for an example.
R=rsc
APPROVED=rsc
DELTA=15 (15 added, 0 deleted, 0 changed)
OCL=30354
CL=30356
- morestack support for 5l and arm runtime
- argsize support in 5c, 5l, ar and nm. assembly code from 5a
will break in interesting ways unless NOSPLIT is specified
- explicit cond execution constants
- fix 5l output to use %d instead of %ld so that negative
values show.
- added a lot of code to arm/asm.s. runtime entry code almost
working currently aborts at gogo not implemented
R=rsc
APPROVED=rsc
DELTA=305 (125 added, 29 deleted, 151 changed)
OCL=30246
CL=30347
not observed: do not use malloc to allocate stacks
during garbage collection, because it would make the
malloc data structures change underfoot.
R=r
DELTA=6 (3 added, 0 deleted, 3 changed)
OCL=30323
CL=30326
- 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
www.google.com seems to be redirecting requests in an infinite loop. I haven't tracked down whether it's their code or this code that is causing it. This is just a quick fix so that this test passes.
APPROVED=r
DELTA=4 (0 added, 0 deleted, 4 changed)
OCL=30178
CL=30210
use -j4 (4-way parallel) in make.bash.
halves time for make.bash on r45
also add libregexp, acid to default build
R=r
DELTA=90 (39 added, 37 deleted, 14 changed)
OCL=15485
CL=15487