]> Cypherpunks repositories - gostls13.git/commitdiff
Make regexp build and install officially
authorRob Pike <r@golang.org>
Wed, 15 Oct 2008 05:16:45 +0000 (22:16 -0700)
committerRob Pike <r@golang.org>
Wed, 15 Oct 2008 05:16:45 +0000 (22:16 -0700)
R=rsc
DELTA=335  (172 added, 156 deleted, 7 changed)
OCL=17167
CL=17180

src/lib/clean.bash
src/lib/container/vector.go
src/lib/make.bash
src/lib/regexp/Makefile
src/lib/regexp/test.go [moved from src/lib/regexp/main.go with 98% similarity]
src/run.bash

index 93bb64a15a9215049c9450b970f4915a71f057e6..e3d7b612f300abbb9fa1a9678c3ff4757d9635bb 100755 (executable)
@@ -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
index 72a0fff742d5f57c8618cb351285a240067b7882..c646917678fff80afd6b7d8b1ddad01dc1828ea4 100644 (file)
@@ -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
index c791b239306dd329a4d7dea672353b794365fed7..5cc976262cb32b0134d1b84734b31630e1657ed4 100755 (executable)
@@ -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
index ac466a0f1904ee8487845dfe370ad7807b34f2ba..86c1680f3e63c98b25954bcddbe4cc21cecbb798 100644 (file)
@@ -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 $<
similarity index 98%
rename from src/lib/regexp/main.go
rename to src/lib/regexp/test.go
index c89f9b5579f41b42f2469d233cc873121a092c27..223064c071d2ca4eee4002a7665f27063eb6cbda 100644 (file)
@@ -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 },      
index cd33b891ed977e57e68bd390cfb50924d0b6de63..72a54062155c4a539a5aeafa57309f0fd7eb97f8 100755 (executable)
@@ -10,6 +10,12 @@ xcd() {
        echo --- cd $1
 }
 
+(xcd lib/regexp
+make clean
+time make
+make test
+)
+
 (xcd ../usr/gri/gosrc
 make clean
 time make