diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-24 13:43:18 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-24 13:43:18 -0800 |
| commit | 974bc55c8721b53b0c2c07baad59b86c08d07104 (patch) | |
| tree | 2ae85bbcdecedd2a311365a9586e24a4e7cab1ba /src/pkg/exp/datafmt/parser.go | |
| parent | 3dd6b9b693f7580651de03546db8fd1805aa0cdf (diff) | |
| download | golang-974bc55c8721b53b0c2c07baad59b86c08d07104.tar.gz | |
Change to container/vector interface:
- removed New(len int) in favor of new(Vector).Resize(len, cap)
- removed Init(len int) in favor of Resize(len, cap)
- runs all.bash
Fixes issue 294.
R=rsc, r, r1
http://codereview.appspot.com/157143
Diffstat (limited to 'src/pkg/exp/datafmt/parser.go')
| -rw-r--r-- | src/pkg/exp/datafmt/parser.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pkg/exp/datafmt/parser.go b/src/pkg/exp/datafmt/parser.go index 648ffd661..c8144d9f2 100644 --- a/src/pkg/exp/datafmt/parser.go +++ b/src/pkg/exp/datafmt/parser.go @@ -40,7 +40,7 @@ func (p *parser) next() { func (p *parser) init(filename string, src []byte) { - p.ErrorVector.Init(); + p.ErrorVector.Reset(); p.scanner.Init(filename, src, p, scanner.AllowIllegalChars); // return '@' as token.ILLEGAL w/o error message p.next(); // initializes pos, tok, lit p.packs = make(map[string]string); @@ -144,7 +144,6 @@ func (p *parser) parseLiteral() literal { // that start with "%" possibly followed by a last segment that // starts with some other character. var list vector.Vector; - list.Init(0); i0 := 0; for i := 0; i < len(s); i++ { if s[i] == '%' && i+1 < len(s) { @@ -239,7 +238,6 @@ func (p *parser) parseOperand() (x expr) { func (p *parser) parseSequence() expr { var list vector.Vector; - list.Init(0); for x := p.parseOperand(); x != nil; x = p.parseOperand() { list.Push(x) @@ -264,7 +262,6 @@ func (p *parser) parseSequence() expr { func (p *parser) parseExpression() expr { var list vector.Vector; - list.Init(0); for { x := p.parseSequence(); |
