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

Issue 5755062: code review 5755062: go/parser: better error synchronization (Closed)

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

Description

go/parser: better error synchronization gofmt reports now a single, accurate error for the test case of issue 3106. Also: Added test harness for general error checking and two test cases for now. Fixes issue 3106.

Patch Set 1 #

Patch Set 2 : diff -r 9353aa1efdf3 https://code.google.com/p/go #

Patch Set 3 : diff -r 9353aa1efdf3 https://code.google.com/p/go #

Patch Set 4 : diff -r 5851ef646cbd https://code.google.com/p/go #

Patch Set 5 : diff -r 5851ef646cbd https://code.google.com/p/go #

Total comments: 4

Patch Set 6 : diff -r 5851ef646cbd https://code.google.com/p/go #

Total comments: 1

Patch Set 7 : diff -r 5851ef646cbd https://code.google.com/p/go #

Patch Set 8 : diff -r ac558ba56c4e https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -24 lines) Patch
A src/pkg/go/parser/error_test.go View 1 2 3 4 5 6 7 1 chunk +163 lines, -0 lines 0 comments Download
M src/pkg/go/parser/parser.go View 1 2 3 12 chunks +72 lines, -24 lines 0 comments Download
A src/pkg/go/parser/testdata/commas.src View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
A src/pkg/go/parser/testdata/issue3106.src View 1 2 3 1 chunk +46 lines, -0 lines 0 comments Download

Messages

Total messages: 9
gri
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
13 years, 2 months ago (2012-03-07 01:42:04 UTC) #1
bradfitz
What is the "single, accurate error" for 3106? I would expect it to be in ...
13 years, 2 months ago (2012-03-07 01:50:31 UTC) #2
rsc
I agree. It would be nice to have an error test case for this and ...
13 years, 2 months ago (2012-03-07 03:04:20 UTC) #3
gri
Hello rsc@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 2 months ago (2012-03-07 19:56:46 UTC) #4
bradfitz
LGTM on tests especially. not very familiar with parser code, but seems sane. http://codereview.appspot.com/5755062/diff/10001/src/pkg/go/parser/error_test.go File ...
13 years, 2 months ago (2012-03-07 20:04:52 UTC) #5
rsc
LGTM http://codereview.appspot.com/5755062/diff/10001/src/pkg/go/parser/error_test.go File src/pkg/go/parser/error_test.go (right): http://codereview.appspot.com/5755062/diff/10001/src/pkg/go/parser/error_test.go#newcode91 src/pkg/go/parser/error_test.go:91: func eliminate(t *testing.T, expected map[token.Pos]string, found scanner.ErrorList) { ...
13 years, 2 months ago (2012-03-07 20:06:40 UTC) #6
gri
PTAL http://codereview.appspot.com/5755062/diff/10001/src/pkg/go/parser/error_test.go File src/pkg/go/parser/error_test.go (right): http://codereview.appspot.com/5755062/diff/10001/src/pkg/go/parser/error_test.go#newcode58 src/pkg/go/parser/error_test.go:58: var errRx = regexp.MustCompile(`^/\* *ERROR *"([^"]*)" *\*/$`) On ...
13 years, 2 months ago (2012-03-07 20:14:15 UTC) #7
rsc
LGTM http://codereview.appspot.com/5755062/diff/11006/src/pkg/go/parser/error_test.go File src/pkg/go/parser/error_test.go (right): http://codereview.appspot.com/5755062/diff/11006/src/pkg/go/parser/error_test.go#newcode117 src/pkg/go/parser/error_test.go:117: t.Errorf("%s: no (multiple?) error expected, but found: %s", ...
13 years, 2 months ago (2012-03-07 20:15:34 UTC) #8
gri
13 years, 2 months ago (2012-03-07 20:24:23 UTC) #9
*** Submitted as http://code.google.com/p/go/source/detail?r=097e02a1815a ***

go/parser: better error synchronization

gofmt reports now a single, accurate error for
the test case of issue 3106.

Also: Added test harness for general error
checking and two test cases for now.

Fixes issue 3106.

R=rsc, bradfitz
CC=golang-dev
http://codereview.appspot.com/5755062
Sign in to reply to this message.

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