summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-10-14 22:16:45 -0700
committerRob Pike <r@golang.org>2008-10-14 22:16:45 -0700
commit960e80014c5a48034b8a659f7848c157cb6cc78d (patch)
treec42e4b589b6f9917025212a9d3f7df1636593c69 /src/lib
parent16be30e3e544eee9dfd359666b1449bd3f910bd1 (diff)
downloadgolang-960e80014c5a48034b8a659f7848c157cb6cc78d.tar.gz
Make regexp build and install officially
R=rsc DELTA=335 (172 added, 156 deleted, 7 changed) OCL=17167 CL=17180
Diffstat (limited to 'src/lib')
-rwxr-xr-xsrc/lib/clean.bash2
-rw-r--r--src/lib/container/vector.go4
-rwxr-xr-xsrc/lib/make.bash2
-rw-r--r--src/lib/regexp/Makefile16
-rw-r--r--src/lib/regexp/test.go (renamed from src/lib/regexp/main.go)2
5 files changed, 18 insertions, 8 deletions
diff --git a/src/lib/clean.bash b/src/lib/clean.bash
index 93bb64a15..e3d7b612f 100755
--- a/src/lib/clean.bash
+++ b/src/lib/clean.bash
@@ -6,7 +6,7 @@
rm -f $GOROOT/pkg/*
-for i in syscall os math net time
+for i in syscall os math net time http regexp
do
cd $i
make nuke
diff --git a/src/lib/container/vector.go b/src/lib/container/vector.go
index 72a0fff74..c64691767 100644
--- a/src/lib/container/vector.go
+++ b/src/lib/container/vector.go
@@ -56,6 +56,10 @@ func (v *Vector) Remove(i int) Element {
}
+func (v *Vector) Reset() {
+ v.elem = v.elem[0:0];
+}
+
func (v *Vector) Insert(i int, e Element) {
n := v.Len();
// range check unnecessary - done by runtime
diff --git a/src/lib/make.bash b/src/lib/make.bash
index c791b2393..5cc976262 100755
--- a/src/lib/make.bash
+++ b/src/lib/make.bash
@@ -33,7 +33,7 @@ do
6g -o $GOROOT/pkg/$base.6 $i
done
-for i in net time http
+for i in net time http regexp
do
echo; echo; echo %%%% making lib/$i %%%%; echo
cd $i
diff --git a/src/lib/regexp/Makefile b/src/lib/regexp/Makefile
index ac466a0f1..86c1680f3 100644
--- a/src/lib/regexp/Makefile
+++ b/src/lib/regexp/Makefile
@@ -5,16 +5,22 @@
A=6
G=$(A)g
L=$(A)l
+PKG=$(GOROOT)/pkg/regexp.$A
-all: main
+test: main.$A test.$A
+ $L -o test test.$A
+ ./test
-main: main.6
- $L -o main main.6
+install: regexp.$A
+ cp regexp.$A $(PKG)
-main.6: regexp.6
+main: main.$A
+ $L -o main main.$A
+
+main.$A: regexp.$A
clean:
- rm -f *.6 main
+ rm -f *.6 test
%.6: %.go
$G $<
diff --git a/src/lib/regexp/main.go b/src/lib/regexp/test.go
index c89f9b557..223064c07 100644
--- a/src/lib/regexp/main.go
+++ b/src/lib/regexp/test.go
@@ -34,7 +34,7 @@ type StringError struct {
err *os.Error;
}
var bad_re = []StringError{
- StringError{ `*`, regexp.ErrBareClosure },
+ StringError{ `*`, regexp.ErrBareClosure },
StringError{ `(abc`, regexp.ErrUnmatchedLpar },
StringError{ `abc)`, regexp.ErrUnmatchedRpar },
StringError{ `x[a-z`, regexp.ErrUnmatchedLbkt },