summaryrefslogtreecommitdiff
path: root/src/pkg/template
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-12 13:19:17 -0700
committerRuss Cox <rsc@golang.org>2009-08-12 13:19:17 -0700
commit2ee4549f599ed214693abf75163176f178b4188c (patch)
treec9dbc55a8447806706f8ae757a04c3c41b815835 /src/pkg/template
parent5ff5b6823c8a023da5c9d6ccc2effe7fad8447f6 (diff)
downloadgolang-2ee4549f599ed214693abf75163176f178b4188c.tar.gz
convert non-low-level non-google pkg code
to whole-package compilation. R=r OCL=33070 CL=33101
Diffstat (limited to 'src/pkg/template')
-rw-r--r--src/pkg/template/Makefile66
-rw-r--r--src/pkg/template/template.go8
-rw-r--r--src/pkg/template/template_test.go1
3 files changed, 6 insertions, 69 deletions
diff --git a/src/pkg/template/Makefile b/src/pkg/template/Makefile
index e91c08818..832f5046c 100644
--- a/src/pkg/template/Makefile
+++ b/src/pkg/template/Makefile
@@ -2,67 +2,11 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-# DO NOT EDIT. Automatically generated by gobuild.
-# gobuild -m >Makefile
-
-D=
-
include $(GOROOT)/src/Make.$(GOARCH)
-AR=gopack
-
-default: packages
-
-clean:
- rm -rf *.[$(OS)] *.a [$(OS)].out _obj
-
-test: packages
- gotest
-
-coverage: packages
- gotest
- 6cov -g `pwd` | grep -v '_test\.go:'
-
-%.$O: %.go
- $(GC) -I_obj $*.go
-
-%.$O: %.c
- $(CC) $*.c
-
-%.$O: %.s
- $(AS) $*.s
-
-O1=\
- format.$O\
-
-O2=\
- template.$O\
-
-
-phases: a1 a2
-_obj$D/template.a: phases
-
-a1: $(O1)
- $(AR) grc _obj$D/template.a format.$O
- rm -f $(O1)
-
-a2: $(O2)
- $(AR) grc _obj$D/template.a template.$O
- rm -f $(O2)
-
-
-newpkg: clean
- mkdir -p _obj$D
- $(AR) grc _obj$D/template.a
-
-$(O1): newpkg
-$(O2): a1
-$(O3): a2
-
-nuke: clean
- rm -f $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/template.a
-packages: _obj$D/template.a
+TARG=template
+GOFILES=\
+ format.go\
+ template.go\
-install: packages
- test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D
- cp _obj$D/template.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/template.a
+include $(GOROOT)/src/Make.pkg
diff --git a/src/pkg/template/template.go b/src/pkg/template/template.go
index 956e45257..a75265535 100644
--- a/src/pkg/template/template.go
+++ b/src/pkg/template/template.go
@@ -63,7 +63,6 @@ import (
"reflect";
"runtime";
"strings";
- "template";
)
// Errors returned during parsing and execution. Users may extract the information and reformat
@@ -442,8 +441,7 @@ func (t *Template) parseSimple(item []byte) (done bool, tok int, w []string) {
return false, tok, w
}
-// parseSection and parseRepeated are mutually recursive
-func (t *Template) parseSection(words []string) *sectionElement
+// parseRepeated and parseSection are mutually recursive
func (t *Template) parseRepeated(words []string) *repeatedElement {
r := new(repeatedElement);
@@ -641,10 +639,6 @@ func (t *Template) writeVariable(v *variableElement, st *state) {
t.execError(st, v.linenum, "missing formatter %s for variable %s", v.formatter, v.name)
}
-// execute{|Element|Section|Repeated} are mutually recursive
-func (t *Template) executeSection(s *sectionElement, st *state)
-func (t *Template) executeRepeated(r *repeatedElement, st *state)
-
// Execute element i. Return next index to execute.
func (t *Template) executeElement(i int, st *state) int {
switch elem := t.elems.At(i).(type) {
diff --git a/src/pkg/template/template_test.go b/src/pkg/template/template_test.go
index c293f6646..f31f43d1e 100644
--- a/src/pkg/template/template_test.go
+++ b/src/pkg/template/template_test.go
@@ -10,7 +10,6 @@ import (
"io";
"os";
"reflect";
- "template";
"testing";
)