]> Cypherpunks repositories - gostls13.git/commit
token/position: implemented Pos
authorRobert Griesemer <gri@golang.org>
Sat, 13 Nov 2010 00:39:33 +0000 (16:39 -0800)
committerRobert Griesemer <gri@golang.org>
Sat, 13 Nov 2010 00:39:33 +0000 (16:39 -0800)
commit18ae633472f312026cff8b31c899102e509ab96d
tree7cb1aaf3fa5774eded9504a724b30885b0effd03
parenta2a4e0c01af416f0ca1892cefa176942ed103c16
token/position: implemented Pos

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
src/pkg/go/token/Makefile
src/pkg/go/token/position.go [new file with mode: 0644]
src/pkg/go/token/token.go