Robert Griesemer [Thu, 27 Jan 2011 22:11:58 +0000 (14:11 -0800)]
godoc: tiny bug fix - use correct filename when comparing files against the index whitelist
This bug prevented files such as READMEs etc. from being included in the index.
For instance, now author names recorded in the AUTHORS file can be found with
a godoc query.
Gustavo Niemeyer [Thu, 27 Jan 2011 19:09:03 +0000 (14:09 -0500)]
6l: Relocate CMOV* instructions
The linker avoids a GOT indirection by turning a MOV into
a LEA, but with x86-64 GCC has started emitting CMOV*
instructions which break the existing logic.
This will generate errors such as:
unexpected GOT reloc for non-dynamic symbol luaO_nilobject_
The CMOV* instructions may be emitted with normal code like:
if (o >= L->top) return cast(TValue *, luaO_nilobject);
else return o;
Which gets compiled into (relocation offset at 1b):
Robert Griesemer [Tue, 25 Jan 2011 21:32:56 +0000 (13:32 -0800)]
scanner: fix Position returned by Scan, Pos
The implementation of the position computation
was surprisingly broken. Implemented fixes and
added extra test cases.
There is a slight interface change: Calling
Pos() returns the current position; but if
called before Scan() that position may not
be the position of the next token returned
by Scan() (depending on the scan settings
and the source text) - this in contrast to
the original comment.
However, after calling Scan(), the Scanner's
Position field reports the position of the
scanned token, as before.
Gustavo Niemeyer [Tue, 25 Jan 2011 01:36:13 +0000 (11:36 +1000)]
misc: Import/Drop commands for Vim
New ftplugin adds Import and Drop commands for Go buffers
in Vim. These commands ensure that the provided package is
imported (or not imported) in the current Go buffer, using
proper style and ordering, without moving the cursor.
E.g.
:Import strings
:ImportAs . strings
:Drop strings
Two mappings are also introduced to help with the fmt package:
Hector Chu [Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)]
codereview: fix windows
Uploading go files on Windows aborts with gofmt: exceptions.ValueError:
close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr
R=rsc, mattn, Joe Poirier
CC=golang-dev
https://golang.org/cl/4025046
Rob Pike [Sat, 22 Jan 2011 00:10:39 +0000 (16:10 -0800)]
gob: fix the grammar comments to match the encoder
(or at least a correct encoder, still to come).
Change the debug structure slightly to better represent
the grammar.
Minor tweaks for consistency in type.go.
Ian Lance Taylor [Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)]
net: Fix race condition in test.
The test code used to do this:
for _, tc := range tests {
ch <- &tc
}
Note that &tc is always the same value here. As the value is
received from the channel, the sender can loop around and
change the contents of tc. This means that the receiver's
value is unstable and can change while it is in use.
Rob Pike [Fri, 21 Jan 2011 19:28:53 +0000 (11:28 -0800)]
gob: better debugging, commentary
Re-implement the debugging helper to be independent of the existing
implementation. This is preparatory to a rewrite to clean up issue 1416.
Include a definition of the grammar of the data stream.
Anschel Schaffer-Cohen [Fri, 21 Jan 2011 03:58:08 +0000 (19:58 -0800)]
Fixed documentation for netchan import()
This was broken after the last update (2011-01-20).
However, I'm not sure if the changed example is a
sensible use of import(), so I'd appreciate comments.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4067043
Russ Cox [Thu, 20 Jan 2011 14:20:47 +0000 (09:20 -0500)]
runtime: make select fairer
The o+i*p approach to visiting select cases in random
order stops being fair when there is some case that
is never ready. If that happens, then the case that follows
it in the order gets more chances than the others.
In general the only way to ensure fairness is to make
all permutations equally likely. I've done that by computing
one explicitly.
Makes the permutations correct for n >= 4 where
previously they were broken. For n > 12, there's not
enough randomness to do a perfect job but this should
still be much better than before.
Robert Griesemer [Thu, 20 Jan 2011 04:07:21 +0000 (23:07 -0500)]
go spec: remove float, complex in favor of float64 and complex128
The default float type is not very useful but for the most basic applications.
For instance, as it is now, using the math package requires conversions for float
variables (the arguments for math functions are usually float64). Typical real
applications tend to specify the floating point precision required.
This proposal removes the predeclared types float and complex. Variable declarations
without type specification but with constant floating point or complex initializer
expressions will assume the type float64 or complex128 respectively.
The predeclared function cmplx is renamed to complex.
Robert Griesemer [Wed, 19 Jan 2011 22:33:05 +0000 (14:33 -0800)]
godoc: enable fulltext index by default
- added flag -maxresults (default: 10000) to limit the max.
number of full text results shown
- removed flag -fulltext; use -maxresults=0 to disable fulltext
index
- better indication on result page if not all results are shown
(... after line list)
Robert Griesemer [Wed, 19 Jan 2011 20:48:10 +0000 (12:48 -0800)]
godoc: enable qualified identifiers ("math.Sin") as query strings again
A query string of the form ident.ident will be used both as a qualified
identifier for identifier search and as a regular expression.
Qualified identifier lookup got broken accidentally when introducing
regexp full text search. Cleaned up surrounding logic a bit.
Gustavo Niemeyer [Wed, 19 Jan 2011 20:43:58 +0000 (15:43 -0500)]
xml: handle tag paths through the same element
With the current implementation, xml unmarshalling
will silently fail to unmarshal any paths passing
through the same element, such as:
type T struct {
A string "dummy>a"
B string "dummy>b"
}
This change tweaks the algorithm so that this works
correctly.
Also, using paths that would cause the same element to
unmarshal twice will error out ahead of time explaining
the problem, rather than silently misbehaving.
Roger Peppe [Wed, 19 Jan 2011 20:28:49 +0000 (12:28 -0800)]
netchan: do not block sends; implement flow control.
When data is received for a channel, but that channel
is not ready to receive it, the central run() loop
is currently blocked, but this can lead to deadlock
and interference between independent channels.
This CL adds an explicit buffer size to netchan
channels (an API change) - the sender will not
send values until the buffer is non empty.
The protocol changes to send ids rather than channel names
because acks can still be sent after a channel is hung up,
we we need an identifier that can be ignored.