Russ Cox
2050a9e478
build: remove Make.pkg, Make.tool
...
Consequently, remove many package Makefiles,
and shorten the few that remain.
gomake becomes 'go tool make'.
Turn off test phases of run.bash that do not work,
flagged with $BROKEN. Future CLs will restore these,
but this seemed like a big enough CL already.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Brad Fitzpatrick
73ce14d0aa
regexp: remove vestigial Error type
...
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5573069
2012-01-25 14:50:37 -08:00
Olivier Duperray
e5c1f3870b
pkg: Add & fix Copyright of "hand generated" files
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554064
2012-01-19 10:14:56 -08:00
Russ Cox
21d3721eb8
regexp: add SubexpNames
...
Fixes #2440 .
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5559043
2012-01-19 01:24:01 -05:00
Rob Pike
6b772462e4
panics: use the new facilities of testing.B instead
...
Lots of panics go away.
Also fix a name error in html/template.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5498045
2011-12-20 10:36:25 -08:00
Russ Cox
a250f37cbc
update tree for new default type rule
...
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5448091
2011-12-08 22:08:03 -05:00
Russ Cox
2f2cc24cd8
regexp: avoid allocation of input interface
...
Matters most for small inputs, because there is no real work
to amortize the allocation effort against.
benchmark old ns/op new ns/op delta
BenchmarkLiteral 613 473 -22.84%
BenchmarkNotLiteral 4981 4931 -1.00%
BenchmarkMatchClass 7289 7122 -2.29%
BenchmarkMatchClass_InRange 6618 6663 +0.68%
BenchmarkReplaceAll 7843 7233 -7.78%
BenchmarkAnchoredLiteralShortNonMatch 329 228 -30.70%
BenchmarkAnchoredLiteralLongNonMatch 322 228 -29.19%
BenchmarkAnchoredShortMatch 838 715 -14.68%
BenchmarkAnchoredLongMatch 824 715 -13.23%
benchmark old MB/s new MB/s speedup
BenchmarkMatchEasy0_32 119.73 196.61 1.64x
BenchmarkMatchEasy0_1K 540.58 538.33 1.00x
BenchmarkMatchEasy0_32K 732.57 714.00 0.97x
BenchmarkMatchEasy0_1M 726.44 708.36 0.98x
BenchmarkMatchEasy0_32M 707.77 691.45 0.98x
BenchmarkMatchEasy1_32 102.12 136.11 1.33x
BenchmarkMatchEasy1_1K 298.31 307.04 1.03x
BenchmarkMatchEasy1_32K 273.56 274.43 1.00x
BenchmarkMatchEasy1_1M 268.42 269.23 1.00x
BenchmarkMatchEasy1_32M 266.15 267.34 1.00x
BenchmarkMatchMedium_32 2.53 3.38 1.34x
BenchmarkMatchMedium_1K 9.37 9.57 1.02x
BenchmarkMatchMedium_32K 9.29 9.67 1.04x
BenchmarkMatchMedium_1M 9.42 9.66 1.03x
BenchmarkMatchMedium_32M 9.41 9.62 1.02x
BenchmarkMatchHard_32 6.66 6.75 1.01x
BenchmarkMatchHard_1K 6.81 6.85 1.01x
BenchmarkMatchHard_32K 6.79 6.85 1.01x
BenchmarkMatchHard_1M 6.82 6.83 1.00x
BenchmarkMatchHard_32M 6.80 6.80 1.00x
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5453076
2011-12-07 15:03:05 -05:00
Russ Cox
2666b815a3
use new strconv API
...
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.
No attempt is made to use the new Append functions
even though there are definitely opportunities.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Russ Cox
7a6a9755a9
regexp: fix doc comment
...
Fixes #2432 .
R=r, r
CC=golang-dev
https://golang.org/cl/5376041
2011-11-09 13:46:54 -05:00
Rob Pike
45e3bcb343
renaming_3: gofix -r go1pkgrename src/pkg/[m-z]*
...
R=rsc
CC=golang-dev
https://golang.org/cl/5345045
2011-11-08 15:41:54 -08:00
Russ Cox
492098eb75
all: rename os.Error to error in various non-code contexts
...
R=adg
CC=golang-dev
https://golang.org/cl/5328062
2011-11-01 22:58:09 -04:00
Russ Cox
eb6929299b
src/pkg/[n-z]*: gofix -r error -force=error
...
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox
3e52dadfd7
regexp: use rune
...
Public API of syntax tree changes.
R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5302046
2011-10-25 22:20:57 -07:00
Russ Cox
8f699a3fb9
regexp: speedups
...
MatchEasy0_1K 500000 4207 ns/op 243.35 MB/s
MatchEasy0_1K_Old 500000 4625 ns/op 221.40 MB/s
MatchEasy0_1M 500 3948932 ns/op 265.53 MB/s
MatchEasy0_1M_Old 500 3943926 ns/op 265.87 MB/s
MatchEasy0_32K 10000 122974 ns/op 266.46 MB/s
MatchEasy0_32K_Old 10000 123270 ns/op 265.82 MB/s
MatchEasy0_32M 10 127265400 ns/op 263.66 MB/s
MatchEasy0_32M_Old 10 127123500 ns/op 263.95 MB/s
MatchEasy1_1K 500000 5637 ns/op 181.63 MB/s
MatchEasy1_1K_Old 10000 100690 ns/op 10.17 MB/s
MatchEasy1_1M 200 7683150 ns/op 136.48 MB/s
MatchEasy1_1M_Old 10 145774000 ns/op 7.19 MB/s
MatchEasy1_32K 10000 239887 ns/op 136.60 MB/s
MatchEasy1_32K_Old 500 4508182 ns/op 7.27 MB/s
MatchEasy1_32M 10 247103500 ns/op 135.79 MB/s
MatchEasy1_32M_Old 1 4660191000 ns/op 7.20 MB/s
MatchMedium_1K 10000 160567 ns/op 6.38 MB/s
MatchMedium_1K_Old 10000 158367 ns/op 6.47 MB/s
MatchMedium_1M 10 162928000 ns/op 6.44 MB/s
MatchMedium_1M_Old 10 159699200 ns/op 6.57 MB/s
MatchMedium_32K 500 5090758 ns/op 6.44 MB/s
MatchMedium_32K_Old 500 5005800 ns/op 6.55 MB/s
MatchMedium_32M 1 5233973000 ns/op 6.41 MB/s
MatchMedium_32M_Old 1 5109676000 ns/op 6.57 MB/s
MatchHard_1K 10000 249087 ns/op 4.11 MB/s
MatchHard_1K_Old 5000 364569 ns/op 2.81 MB/s
MatchHard_1M 5 256050000 ns/op 4.10 MB/s
MatchHard_1M_Old 5 372446400 ns/op 2.82 MB/s
MatchHard_32K 200 7944525 ns/op 4.12 MB/s
MatchHard_32K_Old 100 11609380 ns/op 2.82 MB/s
MatchHard_32M 1 8144503000 ns/op 4.12 MB/s
MatchHard_32M_Old 1 11885434000 ns/op 2.82 MB/s
R=r, bradfitz
CC=golang-dev
https://golang.org/cl/5134049
2011-09-28 12:00:31 -04:00
Russ Cox
6c230fbc67
regexp: move to old/regexp, replace with exp/regexp
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5127042
2011-09-26 18:33:13 -04:00
Rob Pike
d6f80e1a4c
regexp: document that Regexp is thread-safe.
...
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4667047
2011-06-29 15:41:09 +10:00
Nigel Tao
278952c393
regexp: add a package prefix to error strings.
...
R=r, r
CC=golang-dev
https://golang.org/cl/4630041
2011-06-17 10:50:38 +10:00
Robert Hencke
3fbd478a8a
pkg: spelling tweaks, I-Z
...
also, a few miscellaneous fixes to files outside pkg
R=golang-dev, dsymonds, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/4517116
2011-05-30 18:02:59 +10:00
Rob Pike
7db904c1f6
regexp: add support for matching text read from things that implement
...
ReadRune. (If you have a Reader but not a RuneReader, use bufio.)
The matching code is a few percent slower but significantly cleaner.
R=rsc
CC=golang-dev
https://golang.org/cl/4125046
2011-02-03 13:58:40 -08:00
Rob Pike
8a2d706487
regexp tests: make some benchmarks more meaningful
...
The first two "Literal" tests were silly.
Also fix a naming typo in a couple of tests.
R=rsc
CC=golang-dev
https://golang.org/cl/4127045
2011-02-01 17:48:42 -08:00
Ben Lynn
eb56a79e99
regexp: reject bare ?
...
Minor cleanup:
- removed a duplicate test case
- added a function to remove repeated code
- for consistency, replaced "return nil" with a panic at an
unreachable point
Fixes #1428 .
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4057042
2011-01-19 13:47:04 -05:00
Rob Pike
6a5a527173
regexp: implement early out for failed anchored search.
...
R=rsc
CC=golang-dev
https://golang.org/cl/3813045
2011-01-04 12:43:52 -08:00
Rob Pike
15cb7ed34f
regexp: fix prefix bug.
...
After a prefix match, the old code advanced the length of the
prefix. This is incorrect since the full match might begin
in the middle of the prefix. (Consider "aaaab+" matching
"aaaaaab").
Fixes #1373
R=rsc
CC=golang-dev
https://golang.org/cl/3795044
2011-01-03 11:35:34 -08:00
Rob Pike
c0d0d4ef05
regexp: fix performance bug, make anchored searches fail fast.
...
The bug was that for an anchored pattern such as ^x, the prefix
scan ignored the anchor, and could scan the whole file if there was
no x present. The fix is to do prefix matching after the anchor;
the cost miniscule; the speedups huge.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3837042
2011-01-03 11:31:51 -08:00
Rob Pike
a9e7c9381e
regexp: change Expr() to String(); add HasOperator method to Regexp.
...
It reports whether a regular expression has operators
as opposed to matching literal text.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3731041
2010-12-17 10:23:46 -08:00
Rob Pike
5bd4094d2e
regexp: add HasMeta and regexp.Expr().
...
The former is a boolean function to test whether a string
contains a regular expression metacharacter; the second
returns the string used to compile the regexp.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/3728041
2010-12-16 16:55:26 -08:00
Rob Pike
da1cbe5d11
regexp: simplify code for brackets, per rsc suggestion
...
R=rsc
CC=golang-dev
https://golang.org/cl/3545044
2010-12-14 12:01:35 -08:00
Rob Pike
8bb9e616ed
regexp: speed up by about 30%.
...
The code used interfaces in a pretty, pedagogical way but not efficiently.
Remove unnecessary interface code for significant speedups.
Before:
regexp.BenchmarkLiteral 1000000 2629 ns/op
regexp.BenchmarkNotLiteral 100000 18131 ns/op
regexp.BenchmarkMatchClass 100000 26647 ns/op
regexp.BenchmarkMatchClass_InRange 100000 27092 ns/op
regexp.BenchmarkReplaceAll 100000 27014 ns/op
After:
regexp.BenchmarkLiteral 1000000 2077 ns/op
regexp.BenchmarkNotLiteral 100000 13738 ns/op
regexp.BenchmarkMatchClass 100000 20418 ns/op
regexp.BenchmarkMatchClass_InRange 100000 20999 ns/op
regexp.BenchmarkReplaceAll 100000 21825 ns/op
There's likely more to do without major surgery, but this is a simple, significant step.
R=rsc
CC=golang-dev
https://golang.org/cl/3572042
2010-12-14 11:15:32 -08:00
Kyle Consalus
009aebdba8
Removed bytes.Add and bytes.AddByte; we now have 'append'.
...
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Adam Langley
3cb4bdb9ce
utf8: make EncodeRune's destination the first argument.
...
R=r
CC=golang-dev
https://golang.org/cl/3364041
2010-11-30 16:59:43 -05:00
Rob Pike
1f4d54ea01
regexp: eliminate vector in favor of append.
...
R=rsc
CC=golang-dev
https://golang.org/cl/2795041
2010-10-28 15:54:01 -07:00
Russ Cox
69c4e9380b
use append
...
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Robert Griesemer
3478891d12
gofmt -s -w src misc
...
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Rob Pike
4659f6de38
regexp: delete Iter methods
...
They are unused and not that useful anyway.
R=rsc
CC=golang-dev
https://golang.org/cl/2225045
2010-09-21 21:21:44 +10:00
Rob Pike
ca3b5222eb
regexp: interpret all Go characer escapes \a \b \f \n \r \t \v
...
R=rsc
CC=golang-dev
https://golang.org/cl/2042044
2010-08-30 14:06:59 +10:00
Russ Cox
da392d9136
build: no required environment variables
...
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Rob Pike
69fe3dd754
regexp: grow slices dynamically in the 'All' routines.
...
R=rsc
CC=golang-dev
https://golang.org/cl/1953044
2010-08-16 15:17:34 -07:00
Rob Pike
079a117469
regexp: delete the deprecated methods and tests.
...
R=golang-dev
CC=golang-dev
https://golang.org/cl/1956044
2010-08-12 17:16:37 +10:00
Rob Pike
6610d79eda
regexp: new regularized methods for matching.
...
The previous set was spotty, incomplete, and confusing.
This CL proposes a regular, clean set with clearer names.
It's also complete. Many existing methods will be deprecated,
but not in this CL. Ditto for the tests.
R=rsc, gri
CC=golang-dev, rog
https://golang.org/cl/1946041
2010-08-12 14:41:52 +10:00
Rob Pike
46db2e3c25
regexp: document that backslashes are the escape character.
...
Fixes #1013 .
R=rsc, gri
CC=golang-dev
https://golang.org/cl/1938041
2010-08-09 15:11:02 -07:00
Rob Pike
e05c3668d2
regexp: restore accidentally deleted test item.
...
R=rsc
CC=golang-dev
https://golang.org/cl/1714044
2010-06-22 16:11:21 -07:00
Rob Pike
a8cd6c2012
regexp: bug fix: need to track whether match begins with fixed prefix.
...
Fixes #872 .
R=rsc
CC=golang-dev
https://golang.org/cl/1731043
2010-06-22 16:02:14 -07:00
Kyle Consalus
aae02a1855
Optimization to regexp _CharClass: keep track of overall range of
...
charclass to avoid unnecessarily iterating over ranges.
Also, use the fact that IntVector is an []int to avoid method calls.
On my machine, this brings us from ~27500 ns/op to ~17500 ns/op in the benchmark I've added (it is also faster in the case where a range check
doesn't help, added a benchmark for this too.)
I'd also like to propose that "[]", and "[^]" be disallowed. They aren't useful as far as I can tell, they aren't widely supported, and they make reasoning about character classes a bit more complicated.
R=r
CC=golang-dev
https://golang.org/cl/1495041
2010-06-02 23:04:44 -07:00
Russ Cox
6f33f34bbc
regexp: allow escaping of any punctuation
...
More in line with other regexp packages
and egrep; accommodates overzealous escapers.
R=r
CC=golang-dev
https://golang.org/cl/1008041
2010-04-26 10:00:18 -07:00
Rob Pike
b12007c4ed
testing/regexp: use recover.
...
R=rsc
CC=golang-dev
https://golang.org/cl/816042
2010-03-31 17:57:50 -07:00
Rob Pike
7de610cc61
regexp: use panic/recover to handle errors
...
R=rsc, gri
CC=golang-dev
https://golang.org/cl/821046
2010-03-31 15:58:21 -07:00
Rob Pike
7ffe938f08
regexp: don't return non-nil *Regexp if there is an error.
...
R=gri
CC=golang-dev
https://golang.org/cl/787041
2010-03-26 16:18:20 -07:00
Rob Pike
325cf8ef21
delete all uses of panicln by rewriting them using panic or,
...
in the tests, println+panic.
gofmt some tests too.
R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Robert Griesemer
53f3d0733c
gofmt: more consistent formatting of const/var decls
...
- gofmt -w src misc
- only manually modified file: src/pkg/go/printer/nodes.go
R=rsc
CC=golang-dev, r
https://golang.org/cl/606041
2010-03-16 16:45:54 -07:00
Christopher Wedgwood
520621d24c
regex: Remove unneeded imports from test.
...
R=rsc, adg, r
CC=golang-dev
https://golang.org/cl/264041
2010-03-07 11:17:36 -08:00
Andrew Gerrand
f25e016c60
regexp: add ReplaceAllFunc and ReplaceAllStringFunc
...
R=r
CC=golang-dev
https://golang.org/cl/247041
2010-03-07 12:41:49 +11:00
Russ Cox
9750adbbad
strings: delete Runes, Bytes
...
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports
R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Rob Pike
7db472fd34
The prefix optimization applies only to the first iteration.
...
Fixes #596 .
R=rsc
CC=golang-dev
https://golang.org/cl/206101
2010-02-17 08:49:00 +11:00
Peter Froehlich
e1033d07b4
Add query to find number of subexpressions.
...
This was convenient for me to have without being forced
to parse the regexp myself. I'd understand if it's not
really wanted, but I also think that some meta information
about compiled regexps would be fine.
R=r, rsc
CC=golang-dev
https://golang.org/cl/183044
2009-12-24 08:43:35 +11:00
Robert Griesemer
d65a5cce89
1) Change default gofmt default settings for
...
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
4th set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180049
2009-12-15 15:40:16 -08:00
Robert Griesemer
001a8b11ff
Change to container/vector interface:
...
- removed New(len int) in favor of new(Vector).Resize(len, cap)
- removed Init(len int) in favor of Resize(len, cap)
- runs all.bash
Fixes #294 .
R=rsc, r, r1
https://golang.org/cl/157143
2009-11-24 13:43:18 -08:00
Sergio Luis O. B. Correia
6fc820729e
go: makes it build for the case $GOROOT has whitespaces
...
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes #115 .
R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Rob Pike
3b7f552fbb
fix bug in prefix code: must stop one character before any potential match of an empty string
...
Fixes #308 .
R=rsc
CC=golang-dev
https://golang.org/cl/157142
2009-11-23 14:06:21 -08:00
Russ Cox
9ac4449cb2
gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
...
R=r, gri
CC=golang-dev
https://golang.org/cl/156115
2009-11-20 11:45:05 -08:00
Rob Pike
3e8bb54c2f
fix build
...
R=rsc
https://golang.org/cl/159044
2009-11-20 11:26:40 -08:00
Rob Pike
d324a851c4
slight simplification made possible by the code now processing match states
...
in order of discovery.
R=rsc
https://golang.org/cl/157112
2009-11-20 11:16:57 -08:00
Rob Pike
c62069cc1f
add a match arena to regexp to avoid generating garbage.
...
simple regexps run 20x faster.
the regex-dna benchmark goes 3x faster.
R=rsc
CC=golang-dev
https://golang.org/cl/156108
2009-11-19 23:12:01 -08:00
Rob Pike
a6e1ad2733
two easy optimizations for regexp:
...
1) if char class contains a single character, make it a single character.
(this is used to quote, e.g. [.] rather than \.
2) if regexp begins with ordinary text substring, use plain string match to start engine
R=rsc
CC=golang-dev
https://golang.org/cl/157095
2009-11-19 16:45:50 -08:00
Rob Pike
e70cedfaec
remove bytes.Copy
...
replace all calls with calls to copy
use copy in regexp and bytes.Buffer
R=rsc
CC=golang-dev
https://golang.org/cl/157073
2009-11-18 15:24:24 -08:00
Rob Pike
0263103a05
move evaluation of null-matching instructions one iteration earlier.
...
performance hit of about 20% but more intuitive results for submatches.
we need a good regexp package at some point.
Fixes #110 .
R=rsc
CC=golang-dev
https://golang.org/cl/152131
2009-11-14 12:23:24 -08:00
Rob Pike
845276ae68
remove dead code from test
...
R=rsc
CC=golang-dev
https://golang.org/cl/152118
2009-11-12 23:35:45 -08:00
Robert Griesemer
3bb0032cd6
- 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
2009-11-09 21:23:52 -08:00
Robert Griesemer
40621d5c0d
remove semis after statements in one-statement statement lists
...
R=rsc, r
http://go/go-review/1025029
2009-11-09 12:07:39 -08:00
Robert Griesemer
368f8cbc75
- fine-tuning of one-line func heuristic (nodes.go)
...
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
2009-11-06 14:24:38 -08:00
Robert Griesemer
39fd52d3a0
gofmt'ed missing regexp file
...
(one-line functions will be re-established once we have all
formatted uniformly)
R=r
http://go/go-review/1023004
2009-11-05 17:35:40 -08:00
Robert Griesemer
38006946e6
manual fix for better gofmt result
...
R=r
http://go/go-review/1019005
2009-11-05 17:27:02 -08:00
Rob Pike
56cba8855e
panic can't print interfaces well so use err.String()
...
R=rsc
http://go/go-review/1016041
2009-11-04 15:13:16 -08:00
Rob Pike
cd82d490fc
eliminate goroutine from testing/regexp too.
...
R=rsc
CC=go-dev
http://go/go-review/1018021
2009-11-02 11:24:47 -08:00
Rob Pike
acc54b6c70
take goroutines out of regexp so they can be created
...
during initialization.
R=rsc
CC=go-dev
http://go/go-review/1016023
2009-11-02 10:08:22 -08:00
Russ Cox
094f1d5990
more lgtm files from gofmt
...
R=gri
OCL=35485
CL=35488
2009-10-08 15:14:54 -07:00
Russ Cox
91549438d8
apply gofmt to rand reflect regexp rpc runtime sort strconv strings sync syscall testing time unicode unsafe utf8
...
R=gri
DELTA=1409 (79 added, 24 deleted, 1306 changed)
OCL=35415
CL=35437
2009-10-07 11:55:06 -07:00
Rob Pike
7be770071f
use buf.String() instead of string(buf.Bytes())
...
use strings.Buffer instead of bytes.Buffer in some places
R=rsc
DELTA=40 (0 added, 3 deleted, 37 changed)
OCL=34770
CL=34775
2009-09-17 23:51:06 -07:00
Rob Pike
d5be41fc4e
rename bytes.Buffer.Data() to bytes.Buffer.Bytes()
...
R=rsc
DELTA=152 (6 added, 0 deleted, 146 changed)
OCL=34695
CL=34701
2009-09-16 15:15:00 -07:00
Russ Cox
ca6a0fee1b
more "declared and not used".
...
the last round omitted := range and only
checked 1 out of N vars in a multi-var :=
R=r
OCL=34624
CL=34638
2009-09-15 09:41:59 -07:00
Russ Cox
28eba4877b
fix "declared and not used" errors in non-test code.
...
R=r
DELTA=112 (6 added, 57 deleted, 49 changed)
OCL=34610
CL=34610
2009-09-14 17:20:29 -07:00
Rob Pike
396b47bbbd
generate the unicode tables directly from web database
...
after this CL, two more to come:
1) add an exhaustive test, probably as a variant of maketables
2) add ToUpper, ToLower, ToTitle and associated tests
R=rsc
DELTA=1578 (1007 added, 559 deleted, 12 changed)
OCL=33902
CL=33907
2009-08-26 16:01:31 -07:00
Russ Cox
b04ac108fd
convert non-low-level non-google pkg code
...
to whole-package compilation.
R=r
OCL=33070
CL=33101
2009-08-12 13:19:17 -07:00
Rob Pike
68e250516c
make a simpler regexp implementation with fewer dependencies and put it inside testing.
...
remove "regexp." from regexp tests.
R=rsc
DELTA=1173 (1152 added, 1 deleted, 20 changed)
OCL=33028
CL=33037
2009-08-11 13:54:47 -07:00
Stephen Ma
e4603db393
Add methods AllMatches, AllMatchesString, AllMatchesIter,
...
AllMatchesStringIter, based on sawn and sawzall functions in sawzall.
APPROVED=rsc
DELTA=218 (218 added, 0 deleted, 0 changed)
OCL=32408
CL=32949
2009-08-09 19:30:47 -07:00
Rob Pike
3355cadf3f
support []byte (more efficient) as well as string in the interfaces.
...
change the names; Match is for []byte and MatchString is for string, etc.
R=rsc
DELTA=195 (155 added, 0 deleted, 40 changed)
OCL=32800
CL=32800
2009-08-05 15:44:45 -07:00
Rob Pike
5a4d431dd1
special case: recognize '[^\n]' and make it as fast as '.'
...
R=rsc
DELTA=25 (23 added, 1 deleted, 1 changed)
OCL=32793
CL=32799
2009-08-05 14:40:34 -07:00
Russ Cox
d3a412a5ab
io.StringBytes -> strings.Bytes
...
io.ByteBuffer -> bytes.Buffer
left io.ByteBuffer stub around for now,
for protocol compiler.
R=r
OCL=30861
CL=30872
2009-06-29 15:24:23 -07:00
Steve Newman
a6c7a80b5b
Add a ReplaceAll method to Regexp.
...
APPROVED=r,rsc
DELTA=189 (187 added, 0 deleted, 2 changed)
OCL=30205
CL=30517
2009-06-18 17:55:47 -07:00
Rob Pike
d90e7cbac6
mv src/lib to src/pkg
...
tests: all.bash passes, gobuild still works, godoc still works.
R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00