Also rename Node.{Add,Remove} to Node.{AppendChild,RemoveChild} to
be consistent with the DOM.
benchmark old ns/op new ns/op delta
BenchmarkParser 4042040 3749618 -7.23%
benchmark old MB/s new MB/s speedup
BenchmarkParser 19.34 20.85 1.08x
BenchmarkParser mallocs per iteration is also:
10495 before / 7992 after
R=andybalholm, r, adg
CC=golang-dev
https://golang.org/cl/6495061
This is required by the spec to produce the replacement char.
The fix lies in lib9's rune code.
R=golang-dev, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/6443109
Other than catching an error case that was missed before, this
CL introduces no changes to the template language or API.
For simplicity, templates use spaces as argument separators.
This means that spaces are significant: .x .y is not the same as .x.y.
In the existing code, these cases are discriminated by the lexer,
but that means for instance that (a b).x cannot be distinguished
from (a b) .x, which is lousy. Although that syntax is not
supported yet, we want to support it and this CL is a necessary
step.
This CL emits a "space" token (actually a run of spaces) from
the lexer so the parser can discriminate these cases. It therefore
fixes a couple of undisclosed bugs ("hi".x is now an error) but
doesn't otherwise change the language. Later CLs will amend
the grammar to make .X a proper operator.
There is one unpleasantness: With space a token, three-token
lookahead is now required when parsing variable declarations
to discriminate them from plain variable references. Otherwise
the change isn't bad.
The CL also moves the debugging print code out of the lexer
into the test, which is the only place it's needed or useful.
Step towards resolving issue 3999.
It still remains to move field chaining out of the lexer
and into the parser and make field access an operator.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6492054
No changes to the meaning, just clearer language and more
examples, including illegal rune and string literals.
In particular, "character literal" and "character constant"
are now called "rune literal" and "rune constant" and the
word "character" always refers to the source text, not
program values.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6448137
In the example "units" program for goyacc, the exchange rates were
reciprocals of the correct amounts. Turn them right-side-up
and update them to current figures.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6495053
Fixes#3892.
Swapping the order of the writers inside the MultiWriter ensures
the request will be written to buf before http.ReadRequest completes.
The fencedBuffer is not required to make the test pass on
any machine that I have access too, but as the buf is shared
across goroutines, I think it is necessary for correctness.
R=bradfitz, fullung, franciscossouza
CC=golang-dev
https://golang.org/cl/6483061
Vim autocompletion respects the $GOPATH variable and does not
ignore dashes ('-'), dots ('.') and underscores ('_') like found
in many remote packages.
Environment variable $GOROOT is determined by calling
'go env GOROOT' instead of relying on the user's environment
variables.
Fixes#3876Fixes#3882
R=golang-dev, franciscossouza, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6443151
Use version 2 of the NetBSD signal ABI - both version 2 and version 3
are supported by the kernel, with near identical behaviour. However,
the netbsd32 compat code does not allow version 3 to be used, which
prevents Go netbsd/386 binaries from running in compat mode on a
NetBSD amd64 kernel. Switch to version 2 of the ABI, which is the
same version currently used by NetBSD's libc.
R=minux.ma
CC=golang-dev
https://golang.org/cl/6476068
This shouldn't be an error (see issue 3999), but until it's handled
correctly, treat it as one to avoid confusion. Without this CL,
(A).X parses as two arguments.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6473059
Based on work by Russ Cox. From his CL:
This is generally useful but especially helpful when trying
to use the built-in boolean operators. It lets you write:
{{if not (f 1)}} foo {{end}}
{{if and (f 1) (g 2)}} bar {{end}}
{{if or (f 1) (g 2)}} quux {{end}}
instead of
{{if f 1 | not}} foo {{end}}
{{if f 1}}{{if g 2}} bar {{end}}{{end}}
{{$do := 0}}{{if f 1}}{{$do := 1}}{{else if g 2}}{{$do := 1}}{{end}}{{if $do}} quux {{end}}
The result can be a bit LISPy but the benefit in expressiveness and readability
for such a small change justifies it.
I believe no changes are required to html/template.
Fixes#3276.
R=golang-dev, adg, rogpeppe, minux.ma
CC=golang-dev
https://golang.org/cl/6482056
In the regtest data, surrogates are assigned primary weights based on
the surrogate code point value. Go now converts surrogates to FFFD, however,
meaning that the primary weight is based on this code point instead.
This change drops tests with surrogates and lets the tests pass.
R=r
CC=golang-dev
https://golang.org/cl/6461100
The second parameter for sql.putConn() (err) is always nil. As a result bad
connections are reused, even if the driver returns an driver.ErrBadConn.
Unsing a pointer to err instead achievs the desired behavior.
See http://code.google.com/p/go/issues/detail?id=3777 for more details.
Fixes#3777.
R=golang-dev, dave, bradfitz, jameshuachow, BlakeSGentry
CC=golang-dev
https://golang.org/cl/6348069
CVTSS2SQ's rounding mode is controlled by the RC field of MXCSR;
as we specifically need truncate semantic, we should use CVTTSS2SQ.
Fixes#3804.
R=rsc, r
CC=golang-dev
https://golang.org/cl/6352079
To make it more compliant.
This won't affect the behavior of running on OABI-only kernels.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6475044
YearDay provides the day in the year represented by a given time.Time
object. This value is normally computed as part of other date calculations,
but not exported.
Fixes#3932.
R=golang-dev, r, remyoudompheng
CC=golang-dev, rsc
https://golang.org/cl/6460069
This makes SNI "just work" for callers using the standard http.Client.
Since we now have a test that depends on the httptest.Server cert, change
the cert to be a CA (keeping all other fields the same).
R=bradfitz
CC=agl, dsymonds, gobot, golang-dev
https://golang.org/cl/6448154
NetBSD's built-in linker script for 'ld -r' does not provide a
SEARCH_DIR. As a result libgcc.a is not found when -lgcc is used.
Work around this by determining the path to libgcc (by invoking
gcc with the -print-libgcc-file-name option) and explicitly
referencing the resulting library.
R=golang-dev, iant, aram, lucio.dere, minux.ma
CC=golang-dev
https://golang.org/cl/6470044