Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(79)

Issue 3731041: code review 3731041: regexp: change Expr() to String(); add HasOperator meth... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 6 months ago by r
Modified:
14 years, 6 months ago
Reviewers:
CC:
rsc, gri, golang-dev
Visibility:
Public.

Description

regexp: change Expr() to String(); add HasOperator method to Regexp. It reports whether a regular expression has operators as opposed to matching literal text.

Patch Set 1 #

Patch Set 2 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Patch Set 3 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Total comments: 3

Patch Set 4 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Total comments: 1

Patch Set 5 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Patch Set 6 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Total comments: 1

Patch Set 7 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Patch Set 8 : code review 3731041: regexp: change Expr() to String(); add HasOperator meth... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -31 lines) Patch
M src/pkg/regexp/all_test.go View 1 2 3 4 5 6 7 2 chunks +20 lines, -15 lines 0 comments Download
M src/pkg/regexp/find_test.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/regexp/regexp.go View 1 2 3 4 5 6 3 chunks +20 lines, -14 lines 0 comments Download

Messages

Total messages: 24
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 6 months ago (2010-12-17 06:18:19 UTC) #1
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 6 months ago (2010-12-17 06:22:06 UTC) #2
r
Hold off. I have a better idea.
14 years, 6 months ago (2010-12-17 06:22:56 UTC) #3
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 6 months ago (2010-12-17 06:33:43 UTC) #4
r
OK, ready now. This is what gri needs. -rob
14 years, 6 months ago (2010-12-17 06:35:12 UTC) #5
gri
http://codereview.appspot.com/3731041/diff/8001/src/pkg/regexp/all_test.go File src/pkg/regexp/all_test.go (right): http://codereview.appspot.com/3731041/diff/8001/src/pkg/regexp/all_test.go#newcode287 src/pkg/regexp/all_test.go:287: func parsedHasOperator(s string) bool { where is this used? ...
14 years, 6 months ago (2010-12-17 06:54:08 UTC) #6
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 6 months ago (2010-12-17 08:00:06 UTC) #7
rsc1
http://codereview.appspot.com/3731041/diff/16001/src/pkg/regexp/regexp.go File src/pkg/regexp/regexp.go (right): http://codereview.appspot.com/3731041/diff/16001/src/pkg/regexp/regexp.go#newcode1026 src/pkg/regexp/regexp.go:1026: // HasMeta returns a boolean indicating whether the string ...
14 years, 6 months ago (2010-12-17 13:21:09 UTC) #8
r
On Fri, Dec 17, 2010 at 5:21 AM, <rsc@google.com> wrote: > > http://codereview.appspot.com/3731041/diff/16001/src/pkg/regexp/regexp.go > File ...
14 years, 6 months ago (2010-12-17 16:23:04 UTC) #9
gri
Right now I do the following to find the index of the first metacharacter in ...
14 years, 6 months ago (2010-12-17 17:35:49 UTC) #10
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 6 months ago (2010-12-17 17:41:11 UTC) #11
rsc
It sounds like gri needs something like LiteralPrefix() (prefix string, complete bool) that returns the ...
14 years, 6 months ago (2010-12-17 17:47:33 UTC) #12
r
what you're doing is very special and odd. you're right that Literal isn't the easiest ...
14 years, 6 months ago (2010-12-17 17:49:07 UTC) #13
r
On Fri, Dec 17, 2010 at 9:47 AM, Russ Cox <rsc@golang.org> wrote: > It sounds ...
14 years, 6 months ago (2010-12-17 17:50:57 UTC) #14
rsc
it's not that special. re2/regexp.h has an equivalent function.
14 years, 6 months ago (2010-12-17 17:52:08 UTC) #15
gri
LiteralPrefix might work. But instead of complete, I'd rather have the length of the literal ...
14 years, 6 months ago (2010-12-17 17:56:16 UTC) #16
r
Hello rsc, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 6 months ago (2010-12-17 17:59:34 UTC) #17
rsc
On Fri, Dec 17, 2010 at 09:56, Robert Griesemer <gri@golang.org> wrote: > LiteralPrefix might work. ...
14 years, 6 months ago (2010-12-17 18:01:06 UTC) #18
r
that's a lot more work for me; regexp doesn't have the information it needs. you ...
14 years, 6 months ago (2010-12-17 18:01:28 UTC) #19
r
> In a really aggressive library that's not well defined. > Once you find the ...
14 years, 6 months ago (2010-12-17 18:02:46 UTC) #20
rsc
> In a really aggressive library that's not well defined. For example /(foo.*bar)+baz/ has a ...
14 years, 6 months ago (2010-12-17 18:03:32 UTC) #21
rsc
LGTM http://codereview.appspot.com/3731041/diff/15002/src/pkg/regexp/regexp.go File src/pkg/regexp/regexp.go (right): http://codereview.appspot.com/3731041/diff/15002/src/pkg/regexp/regexp.go#newcode852 src/pkg/regexp/regexp.go:852: // LiteralPrefix returns a boolean indicating whether the ...
14 years, 6 months ago (2010-12-17 18:11:51 UTC) #22
r
*** Submitted as http://code.google.com/p/go/source/detail?r=4ac2c8d87239 *** regexp: change Expr() to String(); add HasOperator method to Regexp. ...
14 years, 6 months ago (2010-12-17 18:23:50 UTC) #23
r
14 years, 6 months ago (2010-12-17 18:23:56 UTC) #24
submitted.
this was a nice opportunity for named result parameters.

-rob
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b