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

Issue 4538123: code review 4538123: exp/regexp/syntax: syntax data structures, parser (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 9 months ago by rsc
Modified:
13 years, 9 months ago
Reviewers:
CC:
r, Sam, kevlar, eds2, golang-dev
Visibility:
Public.

Description

exp/regexp/syntax: syntax data structures, parser Parser is a work in progress but can populate most of the interesting parts of the data structure, so a good checkpoint. All the complicated Perl syntax is missing, as are various important optimizations made during parsing to the syntax tree. The plan is that exp/regexp's API will mimic regexp, and exp/regexp/syntax provides the parser directly for programs that need it (and for implementing exp/regexp). Once finished, exp/regexp will replace regexp.

Patch Set 1 #

Patch Set 2 : diff -r bece9e7a644b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r bece9e7a644b https://go.googlecode.com/hg/ #

Total comments: 45

Patch Set 4 : diff -r 69f12bae0f09 https://go.googlecode.com/hg #

Patch Set 5 : diff -r 69f12bae0f09 https://go.googlecode.com/hg #

Patch Set 6 : diff -r 69f12bae0f09 https://go.googlecode.com/hg #

Total comments: 6

Patch Set 7 : diff -r d1e5d7548fee https://go.googlecode.com/hg #

Total comments: 11

Patch Set 8 : diff -r 881a0fc6528d https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1050 lines, -0 lines) Patch
M src/pkg/Makefile View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/exp/regexp/syntax/Makefile View 1 1 chunk +12 lines, -0 lines 0 comments Download
A src/pkg/exp/regexp/syntax/parse.go View 1 2 3 4 5 6 7 1 chunk +561 lines, -0 lines 0 comments Download
A src/pkg/exp/regexp/syntax/parse_test.go View 1 2 3 4 5 6 7 1 chunk +266 lines, -0 lines 0 comments Download
A src/pkg/exp/regexp/syntax/regexp.go View 1 2 3 4 5 6 7 1 chunk +210 lines, -0 lines 0 comments Download

Messages

Total messages: 18
rsc
Hello r, sam (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 9 months ago (2011-06-08 19:12:41 UTC) #1
kevlar
Very nice. Just a few things I noticed while reading through and trying to understand ...
13 years, 9 months ago (2011-06-08 20:24:39 UTC) #2
rsc
On Wed, Jun 8, 2011 at 16:24, <kevlar@google.com> wrote: > Very nice. Just a few ...
13 years, 9 months ago (2011-06-08 20:26:52 UTC) #3
eds2
I'm excited to see some work on an improved regexp package. Thanks! I noticed a ...
13 years, 9 months ago (2011-06-08 22:30:25 UTC) #4
rsc
> http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/regexp.go#newcode24 > src/pkg/exp/regexp/syntax/regexp.go:24: Sub0 [1]*Regexp // storage > for short Sub > It seems ...
13 years, 9 months ago (2011-06-08 22:43:06 UTC) #5
Sam
http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode30 src/pkg/exp/regexp/syntax/parse.go:30: ErrInternalError ErrorCode = "regexp/syntax: internal error" you only need ...
13 years, 9 months ago (2011-06-09 02:15:49 UTC) #6
r
http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode41 src/pkg/exp/regexp/syntax/parse.go:41: ErrMissingBracket = "missing closing ]" why does the ErrorCode ...
13 years, 9 months ago (2011-06-09 02:56:03 UTC) #7
rsc
http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode30 src/pkg/exp/regexp/syntax/parse.go:30: ErrInternalError ErrorCode = "regexp/syntax: internal error" On 2011/06/09 02:15:49, ...
13 years, 9 months ago (2011-06-09 14:05:13 UTC) #8
rsc
Hello r@golang.org, sam.thorogood@gmail.com, kevlar@google.com, edsrzf@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 9 months ago (2011-06-09 22:14:51 UTC) #9
rsc
PTAL http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode60 src/pkg/exp/regexp/syntax/parse.go:60: NonGreedy // repetition operators are non-greedy by default ...
13 years, 9 months ago (2011-06-09 22:17:14 UTC) #10
Sam
LGTM Although I'm hardly authoritative. http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode60 src/pkg/exp/regexp/syntax/parse.go:60: NonGreedy // repetition operators ...
13 years, 9 months ago (2011-06-10 00:14:54 UTC) #11
rsc
PTAL http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode168 src/pkg/exp/regexp/syntax/parse.go:168: for i > 0 && p.stack[i-1].Op < opPseudo ...
13 years, 9 months ago (2011-06-10 00:27:37 UTC) #12
Sam
http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go#newcode168 src/pkg/exp/regexp/syntax/parse.go:168: for i > 0 && p.stack[i-1].Op < opPseudo { ...
13 years, 9 months ago (2011-06-10 01:03:32 UTC) #13
rsc
On Thu, Jun 9, 2011 at 21:03, <sam.thorogood@gmail.com> wrote: > > http://codereview.appspot.com/4538123/diff/4001/src/pkg/exp/regexp/syntax/parse.go > File src/pkg/exp/regexp/syntax/parse.go ...
13 years, 9 months ago (2011-06-10 01:08:18 UTC) #14
Sam
Sounds good. LGTM again. On Fri, Jun 10, 2011 at 11:08, Russ Cox <rsc@golang.org> wrote: ...
13 years, 9 months ago (2011-06-10 01:10:46 UTC) #15
r
LGTM for checkpoint http://codereview.appspot.com/4538123/diff/6006/src/pkg/exp/regexp/syntax/parse.go File src/pkg/exp/regexp/syntax/parse.go (right): http://codereview.appspot.com/4538123/diff/6006/src/pkg/exp/regexp/syntax/parse.go#newcode12 src/pkg/exp/regexp/syntax/parse.go:12: ) when the time comes, i'd ...
13 years, 9 months ago (2011-06-10 04:49:10 UTC) #16
rsc
> http://codereview.appspot.com/4538123/diff/6006/src/pkg/exp/regexp/syntax/parse.go#newcode12 > src/pkg/exp/regexp/syntax/parse.go:12: ) > when the time comes, i'd like a doc.go with ...
13 years, 9 months ago (2011-06-13 12:55:07 UTC) #17
rsc
13 years, 9 months ago (2011-06-13 13:20:25 UTC) #18
*** Submitted as http://code.google.com/p/go/source/detail?r=5e5d55182675 ***

exp/regexp/syntax: syntax data structures, parser

Parser is a work in progress but can populate most of the
interesting parts of the data structure, so a good checkpoint.
All the complicated Perl syntax is missing, as are various
important optimizations made during parsing to the
syntax tree.

The plan is that exp/regexp's API will mimic regexp,
and exp/regexp/syntax provides the parser directly
for programs that need it (and for implementing exp/regexp).

Once finished, exp/regexp will replace regexp.

R=r, sam.thorogood, kevlar, edsrzf
CC=golang-dev
http://codereview.appspot.com/4538123
Sign in to reply to this message.

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