Commit graph

6172 commits

Author SHA1 Message Date
Ken Thompson 3efb4c3b63 fix bounds check in error recovery
(thanks to avp@mit.edu)

R=rsc
CC=golang-dev
https://golang.org/cl/1998041
2010-08-13 14:30:18 -07:00
Robert Griesemer 1f9dfa294f go AST: First step towards augmenting AST with full type information.
- change ast.Ident back to contain the name and adjust all dependent code
- identifier object information will be added again through an optional
  typechecker phase (in the works).
- remove tracking of scopes in parser - it's easier to do this in a separate
  phase (in the works)
- in godoc, generate popup info table directly instead of through a formatter
  for simpler data flow (at the expense of a little bit more code)

Runs all tests.

As a result of this change, the currently shown popup information
(const, var, type, func, followed by identifier name) will not be
shown anymore temporarily.

R=rsc
CC=golang-dev
https://golang.org/cl/1994041
2010-08-13 10:42:18 -07:00
Rob Pike be97fa4c79 fmt/print: honor Formatter in Print, Println.
Rearrange code to clarify handling of %T, Formatter, GoStringer, and Stringer.

R=rsc
CC=golang-dev
https://golang.org/cl/1973043
2010-08-13 17:26:32 +10:00
Russ Cox e2bde5cf9b runtime: fix another stack split bug
Makes godoc --http=:1234 not crash on linux/amd64.

R=r
CC=golang-dev
https://golang.org/cl/1975044
2010-08-12 23:26:54 -07:00
Alex Brainman 79c62aaa99 os: implement env using native windows api.
Fixes #864.

R=rsc
CC=golang-dev
https://golang.org/cl/1975043
2010-08-13 14:29:23 +10:00
Rob Pike a621a7ef74 delete pkg/once
R=rsc
CC=golang-dev
https://golang.org/cl/1995041
2010-08-13 12:53:27 +10:00
Russ Cox 7886318ca0 codereview: do not send "Abanoned" mail if this CL has
not been mailed out for review.

R=r
CC=golang-dev
https://golang.org/cl/1962046
2010-08-12 14:58:38 -07:00
Robert Griesemer 10ae88f4ab partial correction for CL 1983043: fix various godoc-related regexp calls
R=rsc
CC=golang-dev
https://golang.org/cl/1987041
2010-08-12 11:28:50 -07:00
Rob Pike 079a117469 regexp: delete the deprecated methods and tests.
R=golang-dev
CC=golang-dev
https://golang.org/cl/1956044
2010-08-12 17:16:37 +10:00
Ivan Krasin e8b8aeb02a codereview.py: Fix issues with leading tabulation in the Files: section of CL description.
R=imkrasin, rsc
CC=golang-dev
https://golang.org/cl/1943042
2010-08-12 00:04:17 -07:00
Mikio Hara e41987c821 net: make IPv6 String method standards compliant
draft-ietf-6man-text-addr-representation-07 will introduce
a canonical textual representation format for IPv6 address.

R=rsc
CC=golang-dev
https://golang.org/cl/1856047
2010-08-12 00:03:01 -07:00
Rob Pike d31ee536e8 update the tree to use the new regexp methods
R=rsc
CC=golang-dev
https://golang.org/cl/1983043
2010-08-12 16:48:41 +10:00
Rob Pike 4fb5883253 testing: delete the less useful methods in the testing regexp package
We can add them back using the new naming scheme should it become important.

R=rsc
CC=golang-dev
https://golang.org/cl/1968042
2010-08-12 16:47:52 +10:00
Andrew Gerrand 6e633025c4 re-tag release.2010-08-11
R=rsc
CC=golang-dev
https://golang.org/cl/1983042
2010-08-12 16:02:12 +10:00
Andrew Gerrand 2eff4f952e tag release.2010-08-11
R=rsc
CC=golang-dev
https://golang.org/cl/1951043
2010-08-12 15:52:54 +10:00
Andrew Gerrand 9e23f2b2ce release.2010-08-11
R=rsc
CC=golang-dev
https://golang.org/cl/1954044
2010-08-12 15:51:11 +10:00
Russ Cox 1d77ff5b6b 6g, 8g: handle slice by sub-word-sized index (uint8, int8, uint16, int16)
R=ken2
CC=golang-dev
https://golang.org/cl/1960042
2010-08-11 22:27:47 -07:00
Russ Cox 879b5a02a9 A+C: Mikio Hara (individual CLA)
R=adg
CC=golang-dev
https://golang.org/cl/1971042
2010-08-11 22:22:36 -07:00
Russ Cox 26dde76cee gopack: handle long lines in export data
Also, if the header is bad, exit with a non-zero status.

Other calls to Brdline in the tree, by category:

Reading symbol name from object file:
./cmd/5l/obj.c:486: 		name = Brdline(f, '\0');
./cmd/6l/obj.c:535: 		name = Brdline(f, '\0');
./cmd/8l/obj.c:564: 		name = Brdline(f, '\0');
./libmach/sym.c:292: 		cp = Brdline(bp, '\0');

Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: 	if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: 	if((p = Brdline(b, '\n')) == nil)

Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: 	line = Brdline(f, '\n');

Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: 	while((l = Brdline(b, '\n')) != nil){

Implementing Brdstr:
./libbio/brdstr.c:36: 		p = Brdline(bp, delim);

The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long.  This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.

R=r
CC=golang-dev
https://golang.org/cl/1982041
2010-08-11 22:17:20 -07:00
Russ Cox 14e0df34fd 5g, 8g: dead code (already removed from 6g)
R=ken2
CC=golang-dev
https://golang.org/cl/1983041
2010-08-11 21:58:29 -07:00
Rob Pike 6610d79eda regexp: new regularized methods for matching.
The previous set was spotty, incomplete, and confusing.
This CL proposes a regular, clean set with clearer names.
It's also complete.  Many existing methods will be deprecated,
but not in this CL.  Ditto for the tests.

R=rsc, gri
CC=golang-dev, rog
https://golang.org/cl/1946041
2010-08-12 14:41:52 +10:00
Robert Griesemer d75074974a gofmt: if a semicolon is found unexpectedly, report detailed cause
go/scanner: return information on semicolon (real or inserted) when
	    found in source
go/parser:  better error message when a semicolon is found unexpectedly

For instance, if an unexpected semicolon is found that was automatically
inserted, the parser error message is now:

    "expected '}', found newline"

Fixes #1006.

R=rsc
CC=golang-dev
https://golang.org/cl/1936044
2010-08-11 21:25:52 -07:00
Rob Pike 32a81fa8bb sync.once: document that Do cannot be invoked recursively.
documentation change only.

R=rsc
CC=golang-dev
https://golang.org/cl/1964043
2010-08-12 12:59:37 +10:00
Kyle Consalus 8fcdc6a1e2 Small performance improvements to the HTML tokenizer based on your 'TODO's.
R=nigeltao_golang
CC=golang-dev
https://golang.org/cl/1941042
2010-08-12 09:45:34 +10:00
Scott Lawrence bca3151042 template: added ParseFile method for template.Template
Fixes #971.

Parse/ParseFile methods of Template now match template.Parse and .ParseFile methods.
Also made tests being run on Parse and ParseFile be run on Template.ParseFile as well.

R=r
CC=golang-dev
https://golang.org/cl/1741059
2010-08-11 14:04:03 +10:00
Russ Cox a9a62eef6b gc: bug302
Fixed by http://code.google.com/p/go/source/detail?r=d1f41e20a90e
This just adds a test and checks the return value of Bprint.

R=ken2
CC=golang-dev
https://golang.org/cl/1949042
2010-08-10 17:39:38 -07:00
Russ Cox 9d5da464ff libbio: fix Bprint bug
Make Bprint work even when the amount of output
exceeds the available buffer space.

R=r
CC=golang-dev
https://golang.org/cl/1968041
2010-08-10 17:38:28 -07:00
Nigel Tao 753c9b5710 exp/draw: fix drawRGBA when x0 > x1 and we have to draw right-to-left.
R=r
CC=golang-dev
https://golang.org/cl/1940042
2010-08-11 10:10:17 +10:00
Rob Pike 2bf8741c0f rpc: catch errors from ReadResponseBody.
Fixes #1014.

R=rsc
CC=golang-dev
https://golang.org/cl/1941041
2010-08-10 16:55:02 -07:00
Robert Griesemer b0d0de59a1 fix build: update exp/draw/draw_test.go
R=nigeltao
CC=golang-dev
https://golang.org/cl/1962041
2010-08-10 10:11:28 -07:00
Robert Griesemer d754309489 godoc: report Status 404 if a pkg or file is not found
Fixes #1005.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1935041
2010-08-10 09:52:02 -07:00
Robert Griesemer 9714c2208b asn1: remove superfluous if's, unused function
R=adg
CC=golang-dev
https://golang.org/cl/1743059
2010-08-10 09:50:21 -07:00
Nigel Tao 7d3173fc1d exp/draw: remove the Color, Point and Rectangle types.
image: introduce Transparent and Opaque.

R=r
CC=golang-dev
https://golang.org/cl/1947042
2010-08-10 22:05:11 +10:00
Scott Lawrence 4368a78755 gopack documentation: fixed typo
(Removed extraneous "program".)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1950041
2010-08-10 18:01:00 +10:00
Nigel Tao d4e23b7e37 image: fix comment typo.
R=adg
CC=golang-dev
https://golang.org/cl/1952041
2010-08-10 17:56:57 +10:00
Nigel Tao b50a3d95e1 image: change image representation from slice-of-slices to linear buffer,
stride and rect.

R=r
CC=golang-dev, rog
https://golang.org/cl/1849041
2010-08-10 16:34:57 +10:00
Nigel Tao 56b989f1b9 First cut of an HTML tokenizer (and eventually a parser).
R=r, rsc, gri, rsc1
CC=golang-dev
https://golang.org/cl/1814044
2010-08-10 16:08:21 +10:00
Nigel Tao 96d7c8d4a8 exp/draw/x11: temporarily workaround compiler bug 1011.
R=r
CC=golang-dev
https://golang.org/cl/1951041
2010-08-10 15:53:19 +10:00
Mathieu Lonjaret 90a6c91890 png: grayscale support.
R=nigeltao_golang, r
CC=golang-dev
https://golang.org/cl/1897049
2010-08-10 12:25:08 +10:00
Nigel Tao 5eb35e4247 image: replace Width and Height by Bounds, and introduce the Point and
Rect types.

The actual image representation is unchanged. A future change will
replace the {[][]color} with {[]color, stride int, r Rectangle} and
possibly a clip region.

The draw.Color, draw.Point and draw.Rect types will be removed in a
future change. Trying to do it in this one polluted the diff with
trivia.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1918047
2010-08-10 12:08:52 +10:00
Rob Pike 46db2e3c25 regexp: document that backslashes are the escape character.
Fixes #1013.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/1938041
2010-08-09 15:11:02 -07:00
Scott Lawrence d5cfb3b3d5 goinstall docs: fixed typos
(Added mising closing quotes.)

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1902049
2010-08-09 10:45:20 -07:00
Evan Shaw 28a0971caf big: Several fixes to bitwise functions
Fixed:
* SetString calls in bitwise tests
* Aliasing problem with self bitwise test
* One test case that was just flat out wrong
* Slice panics in nat.or and nat.xor
* Aliasing problems in Int.And, Int.AndNot, Int.Or, Int.Xor

Fixes #1007.

R=gri
CC=golang-dev
https://golang.org/cl/1895049
2010-08-09 10:21:54 -07:00
Nicholas Waples e2c7e53dcf asn1 incorrectly encoded signed integers. When determining the
encoded length it was not taking into account the sign bit.

Fixes #997.

R=agl1, gri
CC=golang-dev
https://golang.org/cl/1870047
2010-08-09 10:25:54 -04:00
Alex Brainman bc4a9caa41 runtime: free memory returned by windows GetEnvironmentStrings
R=golang-dev
CC=golang-dev
https://golang.org/cl/1917048
2010-08-09 11:30:33 +10:00
Alex Brainman dbef0711d4 os: fix ForkExec() handling of envv == nil
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1913047
2010-08-09 11:21:20 +10:00
Nigel Tao 893fdbbe5d image: introduce Decode and RegisterFormat.
R=r, rsc
CC=golang-dev
https://golang.org/cl/1849054
2010-08-09 10:44:38 +10:00
Russ Cox 844a86317d net/textproto: new package, with example net/dict
Generic text-based network protcol library for SMTP-like protocols.
HTTP and NNTP should be changed to use this package,
and I expect that SMTP and POP3 will be able to use it too.

R=cemeyer, nigeltao_golang, r
CC=golang-dev, petar-m
https://golang.org/cl/889041
2010-08-06 17:37:45 -07:00
Rob Pike 18063d4686 fmt.Scan: empty strings are errors
Fixes #1002.

R=rsc
CC=golang-dev
https://golang.org/cl/1882046
2010-08-07 10:02:04 +10:00
Kai Backman df88fc6109 arm: bugfixes and syscall
- integer divide by zero raises panic
- float comparisons involving NaNs work
- syscall interface actually handles return
  values and errno correctly.

R=rsc, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/1847047
2010-08-06 16:57:49 -07:00