maketables.go/tables.go
- Properly set combinesForward flag for JamoL and JamoV.
- Fixed Printf bug.
composition.go
- Make insertString use the same control flow as insert.
- Better Hangul and non-Hangul mixing.
forminfo.go
- Fixed bug in compBoundaryBefore that affected a few esoteric cases.
- Buffer overflow now tested in normalize_test.go (other CL).
R=r
CC=golang-dev
https://golang.org/cl/4924041
- templates should be read before any handlers are started
- for app engine use, must use underlying file system to read templates
R=r
CC=golang-dev
https://golang.org/cl/4928042
In the process, rewrite index.go to use slices instead
of vectors, rewrite for-loops into range loops, and
generally simplify code (this code was written before
the launch of go and showed its age).
Also, fix a wrong import in appinit.go.
No significant performance changes (improvements);
most of time is spent elsewhere (measured on an stand-
alone MacBook Pro with SSD disk, running standard
godoc settings: godoc -v -http=:7777 -index).
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4875056
ParseMediaType previously documented that it always returned
a non-nil map, but also documented that it returned a nil map
to signal an error.
That is confusing, contradictory and not Go-like.
Now it returns (mediatype string, params map, os.Error).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4867054
The subtle AST changes introduced with CL 4896053
broke type checking of type switches in gofix.
Coming up with a correct fix will take some time.
Undoing this change for now.
««« original CL description
go/parser: fix type switch scoping
The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.
Also:
- explicitly detect type switches (as opposed to detecting
regular (expression switches) and then do extra testing
for type switches
- fix all outstanding TODOs in parser.go
R=rsc
CC=golang-dev
https://golang.org/cl/4896053
»»»
R=rsc
CC=golang-dev
https://golang.org/cl/4902052
The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.
Also:
- explicitly detect type switches (as opposed to detecting
regular (expression switches) and then do extra testing
for type switches
- fix all outstanding TODOs in parser.go
R=rsc
CC=golang-dev
https://golang.org/cl/4896053
This CL changes both JoinGroup and LeaveGroup methods
to take an interface as an argument for enabling IPv6
group address join/leave, join a group address on a
specific interface.
R=rsc, dave
CC=golang-dev
https://golang.org/cl/4815074
Allocate Defer on stack during cgo calls, as suggested
by dvyukov. Also includes some comment corrections.
benchmark old,ns/op new,ns/op
BenchmarkCgoCall 669 330
(Intel Xeon CPU 1.80GHz * 4, Linux 386)
R=dvyukov, rsc
CC=golang-dev
https://golang.org/cl/4910041
This defines just enough context to distinguish HTML URI attributes
from parsed character data.
It does not affect any public module API as I thought I would get
early comment on style for defining enumerations and tables.
R=rsc, r, nigeltao, r
CC=golang-dev
https://golang.org/cl/4906043
All tests enabled by default passes except those in timeout_test.go.
For TestLookupPort, add an entry for "bootps" in /lib/ndb/common
(Plan 9 calls it "bootp"). I've sent out a patch to fix this.
R=paulzhol, rsc, mikioh.mikioh
CC=ality, golang-dev
https://golang.org/cl/4779041
forminfo.go:
- Wrappers for table data.
- Per Form dispatch table.
composition.go:
- reorderBuffer type. Implements decomposition, reordering, and composition.
- Note: decompose and decomposeString fields in formInfo could be replaced by
a pointer to the trie for the respective form. The proposed design makes
testing easier, though.
normalization.go:
- Temporarily added panic("not implemented") methods to make the tests run.
These will be removed again with the next CL, which will introduce the
implementation.
R=r, rogpeppe, mpvl, rsc
CC=golang-dev
https://golang.org/cl/4875043
Replaces the toy func Reverse(*Template) with one that implements
naive autoescaping.
Now Escape(*Template) walks a template parse tree to find all
template actions and adds the |html command to them if it is not
already present.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4867049
It's already in old/template; make that build.
Update a couple of references to point to the old template.
They can be updated later.
Update goplay to use exp/template.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4902046
This is just moving the URL code from package http into its own package,
which has been planned for a while.
Besides clarity, this also breaks a nascent dependency cycle the new template
package was about to introduce.
Add a gofix module, url, and use it to generate changes outside http and url.
Sadness about the churn, gladness about some of the naming improvements.
R=dsymonds, bradfitz, rsc, gustavo, r
CC=golang-dev
https://golang.org/cl/4893043
Multicast address handling is not consistent across all BSDs. Move
the multicast address handling code into OS dependent files. This
will be needed for OpenBSD support.
R=mikioh.mikioh, golang-dev
CC=golang-dev
https://golang.org/cl/4809074
The corruption can occur when GOMAXPROCS
is changed from >1 to 1, since GOMAXPROCS=1
does not imply there is only 1 goroutine running,
other goroutines can still be not parked after
the change.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4873050
When the C API being used includes multiple names for the same
underlying symbol (e.g. multiple #define's for the same variable), then
cgo will generate the same placeholder variables for each name. This
then prevents the code from compiling due to multiple declarations of
the same variable - so change cgo to only create one instance of the
variable for the underlying symbol.
R=rsc
CC=golang-dev
https://golang.org/cl/4826055
src/cmd/5c/reg.c:
. Added USED() attribute.
src/cmd/6c/cgen.c:
. Revised code around "REGARG" to resemble use in "8c" and
consequently remove a warning.
src/cmd/6l/asm.c:
. Added USED() attributes.
. Removed an unnecessary assignment.
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4836045
Currently it's possible to write:
var s rpc.Server
...
// reuse for my own purposes
s.Lock()
...
s.Unlock()
which is seemingly not intended.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4888049
This is useful for applications that want to micromanage the rpc service.
Moved part of ServeCodec into a new readRequest function.
Renamed existing readRequest to readRequestHeader, and reordered
its parameters to align with the new readRequest and service.call.
R=golang-dev, r, rsc, sougou
CC=golang-dev, msolomon
https://golang.org/cl/4889043
Do this by adding a fake package called builtin. At the moment, godoc will
not present this documentation because the function names are all lower case,
but there are plans to address this.
The print and println functions are undocumented here. I could be talked
into doing them but I'd rather not promote their use.
R=dsymonds, n13m3y3r, r, gri, rsc
CC=golang-dev
https://golang.org/cl/4907041
CL 4873048 introduced the ability to build without hg and
getting an "unknown" version. While this approach works
to avoid the hg dependency, it also means that every
exported tree that is built without hg or .hg will have not
only missing information, but will also be compatible to
one another. Considering that it is a common practice to
remove the VCS data in distributions, I suggest we don't
take this approach to avoid its consequences.
This CL fixes the same problem in a different way: if a
VERSION file at the top of the tree exists, use it at
all times. If it doesn't, fall back to using information
from hg necessarily, and fail if that's not possible. The
error message when VERSION and hg are not available
instructs users to handle it properly.
The VERSION file can be generated with
"src/version.bash -save" while hg is still around.
R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/4897043
This was initially pushed as part of CL 4876046, found
when logic in exp/template was using the method on
an Invalid value.
R=rsc
CC=golang-dev
https://golang.org/cl/4890043
First step of moving exp/template into template: save the old code.
Code is unedited except for target name in Makefile.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4893042
While using exp/template in practice, the syntax for
indexing values using the "index" action was found to be
very inconvenient for frequent use when handling dynamic
data from maps such as the ones used with json and yaml,
that use a type like map[string]interface{}.
For these kinds of maps, the default handling of fields as
{{.Field}} makes the task of handling the several references
significantly more pleasant and elegant, and is equivalent
to what's currently done in the "template" package and in
other external packages (e.g. mustache).
Even with this change, the index action is still relevant
as it allows indexing maps in other scenarios where keys
wouldn't be valid field names.
R=golang-dev, r, gustavo
CC=golang-dev
https://golang.org/cl/4898043
This avoids a non-obvious panic when range is used on a
nil interface, and fixes it by behaving as if the range
was empty.
The new behavior is equivalent to the outcome of iterating
on a nil map or slice, and is useful because it allows
generic structures such as used in json (map[string]interface{})
to behave correctly if a key generally set to a list or map
isn't present.
R=golang-dev, r, gustavo
CC=golang-dev
https://golang.org/cl/4876046
Since the posLink_url also adds a non-URL attribute, the quoting and URL-escaping
must happen inside posLink_url (otherwise the non-URL attribute becomes part or the
URL portion of the tag.
R=r
CC=golang-dev
https://golang.org/cl/4888041
- rename template funcs for better consistency and
sort them into groups of related functionality
- try to be more consistent with html vs url escaping
R=r
CC=golang-dev
https://golang.org/cl/4887041
- simplified pipelines
- simplified templates by using template variables
- converted most old-style formatters into new-style funcs
- fixed some escaping bugs (use of url escaping where it was missing)
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4868044
func Reverse(*Template) *Template
returns a template that produces the reverse of the original
for any input.
Changes outside exp/template/html include:
- Adding a getter for a template's FuncMap so that derived templates
can inherit function definitions.
- Exported one node factory function, newIdentifier.
Deriving tempaltes requires constructing new nodes, but I didn't
export all of them because I think shallow copy functions might
be more useful for this kind of work.
- Bugfix: Template's Name() method ignores the name field so
template.New("foo") is a nil dereference instead of "foo".
Caveats: Reverse is a toy. It is not UTF-8 safe, and does not
preserve order of calls to funcs in FuncMap.
For context, see http://groups.google.com/group/golang-nuts/browse_thread/thread/e8bc7c771aae3f20/b1ac41dc6f609b6e?lnk=gst
R=rsc, r, nigeltao, r
CC=golang-dev
https://golang.org/cl/4808089
- first step; rough conversion of all template files
- there is plenty of opportunity for cleanups/simplifications (next CLs)
- html and text output as before
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4852048
This continues the work in revision 914a659b44ff, now passing more test
cases. As before, the new tokenization tests match html5lib's behavior.
Fixes#2124.
R=dsymonds, r
CC=golang-dev
https://golang.org/cl/4867042
IMPORTANT: Previous usage of *Files will continue to compile
fine but misbehave since the interface is compatible.
The following functions have been renamed:
ParseFiles => ParseGlob
ParseFile => ParseFiles
ParseSetFiles => ParseSetGlob
ParseSetFile => ParseSetFiles
ParseTemplateFiles => ParseTemplateGlob
ParseTemplateFile => ParseTemplateFiles
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4867041
Fixes#2140.
The http.DefaultTransport's RoundTrip method leaves the http.Request object
in an altered state after performing the round trip. This patch removes
the header from the Request before returning to the client.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4857041
- triegen.go: Factored out trie generation code from maketables.go
(only renamed printTrieTables to printTables and made it a method).
- maketesttables.go: new tool to generate data for the trie unit test.
- Makefile: changed accordingly.
- trie.go: trie lookup code.
- trietest_data.go: generated by maketesttables.go.
- trie_test.go: unit test for trie.go.
R=r
CC=golang-dev
https://golang.org/cl/4844053
- triegen.go: Factored out trie generation code from maketables.go
(only renamed printTrieTables to printTables and made it a method).
- maketesttables.go: new tool to generate data for the trie unit test.
- Makefile: changed accordingly.
- trie.go: trie lookup code.
- trietest_data.go: generated by maketesttables.go.
- trie_test.go: unit test for trie.go.
R=r
CC=golang-dev
https://golang.org/cl/4844053
Every time we enter callback from Windows, it is
possible that go exception handler is not at the top
of per-thread exception handlers chain. So it needs
to be installed again. At this moment this is done
by replacing top SEH frame with SEH frame as at time
of syscall for the time of callback. This is incorrect,
because, if exception strike, we won't be able to call
any exception handlers installed inside syscall,
because they are not in the chain. This changes
procedure to add new SEH frame on top of existing
chain instead.
I also removed m sehframe field, because I don't
think it is needed. We use single global exception
handler everywhere.
R=golang-dev, r
CC=golang-dev, hectorchu
https://golang.org/cl/4832060
Mostly a mechanical change, with a few cleanups to make the split easier.
The external interface to exp/template is unaffected.
In another round I will play with the function map setup to see if I can
avoid exposing reflect across the boundary, but that will require some
structural changes I did not want to mix into this CL.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4849049