diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 | 
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 | 
| commit | 9aad19327eb719775a874f8f18bb15958db1d471 (patch) | |
| tree | c515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/testing/regexp.go | |
| parent | 073e240233589933c43143c997247c33206bb066 (diff) | |
| download | golang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz | |
- replaced gofmt expression formatting algorithm with
  rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)
R=rsc, r
http://go/go-review/1024041
Diffstat (limited to 'src/pkg/testing/regexp.go')
| -rw-r--r-- | src/pkg/testing/regexp.go | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/src/pkg/testing/regexp.go b/src/pkg/testing/regexp.go index 5093d512e..f708db44b 100644 --- a/src/pkg/testing/regexp.go +++ b/src/pkg/testing/regexp.go @@ -183,7 +183,7 @@ func (cclass *_CharClass) addRange(a, b int) {  }  func (cclass *_CharClass) matches(c int) bool { -	for i := 0; i < len(cclass.ranges); i = i+2 { +	for i := 0; i < len(cclass.ranges); i = i + 2 {  		min := cclass.ranges[i];  		max := cclass.ranges[i+1];  		if min <= c && c <= max { @@ -281,7 +281,7 @@ func (p *parser) nextc() int {  	if p.pos >= len(p.re.expr) {  		p.ch = endOfFile  	} else { -		c, w := utf8.DecodeRuneInString(p.re.expr[p.pos : len(p.re.expr)]); +		c, w := utf8.DecodeRuneInString(p.re.expr[p.pos:len(p.re.expr)]);  		p.ch = c;  		p.pos += w;  	} @@ -677,7 +677,7 @@ func (re *Regexp) doExecute(str string, bytes []byte, pos int) []int {  	for pos <= end {  		if !found {  			// prime the pump if we haven't seen a match yet -			match := make([]int, 2*(re.nbra + 1)); +			match := make([]int, 2*(re.nbra+1));  			for i := 0; i < len(match); i++ {  				match[i] = -1	// no match seen; catches cases like "a(b)?c" on "ac"  			} @@ -732,12 +732,12 @@ func (re *Regexp) doExecute(str string, bytes []byte, pos int) []int {  				s[in] = addState(s[in], st.inst.next(), st.match);  			case _EBRA:  				n := st.inst.(*_Ebra).n; -				st.match[2*n + 1] = pos; +				st.match[2*n+1] = pos;  				s[in] = addState(s[in], st.inst.next(), st.match);  			case _ALT:  				s[in] = addState(s[in], st.inst.(*_Alt).left, st.match);  				// give other branch a copy of this match vector -				s1 := make([]int, 2*(re.nbra + 1)); +				s1 := make([]int, 2*(re.nbra+1));  				for i := 0; i < len(s1); i++ {  					s1[i] = st.match[i]  				} | 
