A pos value represents a file-set specific, accurate
source position value. It is 8x smaller in size than
the corresponding Position value (4 bytes vs 32 bytes).
Using Pos values instead of Position values in AST
saves approx. 25MBytes of memory when running godoc
on the current repository.
This CL introduces the Pos, File, and FileSet data
types; it does not affect existing code. Another
(pending CL) will make the change to all dependent
source files.
Missing: tests
R=r
CC=golang-dev, rsc
https://golang.org/cl/2936041
Cleaner, but also results in a 25%+ performance improvement for Get()/SetValue() on my machine.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/3072041
The need for a LastIndexAny function has come up in the discussion
for https://golang.org/cl/3008041/. This function is
implemented analogously to lastIndexFunc, using functions from
the utf8 package.
R=r, rsc, PeterGo
CC=golang-dev
https://golang.org/cl/3057041
Added a "return" to the end of an example which previously threw a compile error if used.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3052041
* Add support for certificate policy identifiers
* Fix the version number of generated certificates
* Fix the parsing of version numbers
* Fix the case of multiple name entries (it should have been a list of
tagged values, not a tagged list of values).
R=r
CC=golang-dev
https://golang.org/cl/3044041
When searching a list of directories, the files which match
the pattern are accumulated in a slice. If the glob has a
wildcard for the directory, and the wildcard matches a file
rather than a directory, then the files found so far are
discarded. E.g., path.Glob("*/x") in a directory which
contains both files and subdirectories. This patch avoids
discarding matches found so far when a file is found.
R=r
CC=bsiegert, golang-dev
https://golang.org/cl/3015042
This is in preparation for a different position representation.
It also resolves situations where a node would be printed as
it's node position simply because the embedded token.Position
has a String method.
R=r
CC=golang-dev
https://golang.org/cl/2991041
When it is known that there is already at least one element in the
list, it is awkwardly verbose to use three lines and an extra
variable declaration to remove the first or last item (a common
case), rather than use a simple expression.
a stack:
stk.PushFront(x)
x = stk.Front().Remove().(T)
vs.
stk.PushFront(x)
e := stk.Front()
e.Remove()
x = e.Value.(T)
[An alternative CL might be to add PopFront and PopBack methods].
R=gri
CC=golang-dev
https://golang.org/cl/3000041
As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.
Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.
R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/2476041