Russ Cox [Thu, 12 Aug 2010 05:17:20 +0000 (22:17 -0700)]
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 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.
Rob Pike [Thu, 12 Aug 2010 04:41:52 +0000 (14:41 +1000)]
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.
Robert Griesemer [Thu, 12 Aug 2010 04:25:52 +0000 (21:25 -0700)]
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:
Scott Lawrence [Wed, 11 Aug 2010 04:04:03 +0000 (14:04 +1000)]
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.
Nigel Tao [Tue, 10 Aug 2010 02:08:52 +0000 (12:08 +1000)]
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.
Evan Shaw [Mon, 9 Aug 2010 17:21:54 +0000 (10:21 -0700)]
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
Russ Cox [Sat, 7 Aug 2010 00:37:45 +0000 (17:37 -0700)]
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
Christian Himpel [Thu, 5 Aug 2010 13:11:06 +0000 (23:11 +1000)]
bytes: add IndexRune, FieldsFunc and To*Special
Basically these functions are implemented the same way as the
corresponding functions in the strings package. Test functions
are implemented for IndexRune and FieldsFunc.
Additionally two typos are fixed in packages bytes and strings.
Russ Cox [Thu, 5 Aug 2010 00:50:22 +0000 (17:50 -0700)]
amd64: use segment memory for thread-local storage
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.
Fixes #720.
R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
Robert Griesemer [Thu, 5 Aug 2010 00:21:02 +0000 (17:21 -0700)]
gofmt/go/parser: strengthen syntax checks
- don't allow parenthesized receiver base types or anonymous fields
- fixed a couple of other omissions
- adjusted gofmt test script
- removed several TODOs
Rob Pike [Tue, 3 Aug 2010 22:34:52 +0000 (08:34 +1000)]
os: change the type of permissions argument for Open etc. to uint32.
Besides being more correct, it protects against people accidentally
exchanging the permission and open mode arguments to Open.
Robert Griesemer [Fri, 30 Jul 2010 01:13:41 +0000 (18:13 -0700)]
go_spec: don't allow parens around the literal type of composite literals
Background: The current spec is imprecise with respect to the parsing ambiguity
for composite literals: It says that the ambiguity arises when the TypeName form
of the LiteralType is used. The following code:
if (B) {} ...
is not using the TypeName form (but the parenthesized TypeName form) and thus
could be interpreted as:
if ((B){}) ...
instead of
if B {} ...
Both compilers and gofmt choose the latter interpretation. One could fix the
spec by making the clause regarding the parsing ambiguity more precise ("...using
the _possibly parenthesized_ TypeName form of the LiteralType..."). The alternative
(chosen here) is to simply disallow parenthesized literal types. Except for a single
test case (test/parentype.go) there appears to be no Go code under $GOROOT containing
parenthesized literal types. Furthermore, parentheses are never needed around a
literal type for correct parsing.
test/sigchld.go: use syscall.Kill instead of a combination
of syscall.Syscall and syscall.SYS_KILL.
In RTEMS, there is no syscall.Syscall support, but it does
support POSIX signals. So, if this testcase is changed to use
syscall.Kill, then it would run fine on RTEMS, when using gccgo.