- bug fix: no need to add extra '.' when renaming custom formatters

- added corresponding test case

R=rsc
DELTA=10  (7 added, 1 deleted, 2 changed)
OCL=30055
CL=30059
This commit is contained in:
Robert Griesemer 2009-06-08 14:07:20 -07:00
parent cd80000d8d
commit eec4991863
2 changed files with 9 additions and 3 deletions

View file

@ -399,11 +399,10 @@ func (p *parser) parseFormat() {
func remap(p *parser, name string) string {
i := strings.Index(name, ".");
if i >= 0 {
packageName := name[0 : i];
typeName := name[i : len(name)];
packageName, suffix := name[0 : i], name[i : len(name)];
// lookup package
if importPath, found := p.packs[packageName]; found {
name = importPath + "." + typeName;
name = importPath + suffix;
} else {
var invalidPos token.Position;
p.Error(invalidPos, "package not declared: " + packageName);