diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-30 15:33:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-30 15:33:16 +0000 |
commit | f72f4169133572cf62f1e872c5657cdbc4d5de2c (patch) | |
tree | 9382d76e5dc68294cdf3c4f2c03a9f61b44fb014 /libgo/go/exp/datafmt/parser.go | |
parent | f2034d064c29d9620c5562b2b5b517bdc6c7a672 (diff) | |
download | gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.zip gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.tar.gz gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.tar.bz2 |
Update to current Go library.
From-SVN: r171732
Diffstat (limited to 'libgo/go/exp/datafmt/parser.go')
-rw-r--r-- | libgo/go/exp/datafmt/parser.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/exp/datafmt/parser.go b/libgo/go/exp/datafmt/parser.go index c6d1402..7dedb53 100644 --- a/libgo/go/exp/datafmt/parser.go +++ b/libgo/go/exp/datafmt/parser.go @@ -22,7 +22,7 @@ type parser struct { file *token.File pos token.Pos // token position tok token.Token // one token look-ahead - lit []byte // token literal + lit string // token literal packs map[string]string // PackageName -> ImportPath rules map[string]expr // RuleName -> Expression @@ -62,7 +62,7 @@ func (p *parser) errorExpected(pos token.Pos, msg string) { // make the error message more specific msg += ", found '" + p.tok.String() + "'" if p.tok.IsLiteral() { - msg += " " + string(p.lit) + msg += " " + p.lit } } p.error(pos, msg) @@ -80,7 +80,7 @@ func (p *parser) expect(tok token.Token) token.Pos { func (p *parser) parseIdentifier() string { - name := string(p.lit) + name := p.lit p.expect(token.IDENT) return name } @@ -130,7 +130,7 @@ func (p *parser) parseRuleName() (string, bool) { func (p *parser) parseString() string { s := "" if p.tok == token.STRING { - s, _ = strconv.Unquote(string(p.lit)) + s, _ = strconv.Unquote(p.lit) // Unquote may fail with an error, but only if the scanner found // an illegal string in the first place. In this case the error // has already been reported. @@ -181,7 +181,7 @@ func (p *parser) parseField() expr { var fname string switch p.tok { case token.ILLEGAL: - if string(p.lit) != "@" { + if p.lit != "@" { return nil } fname = "@" |