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

Issue 7232071: code review 7232071: cmd/cgo: fix line number annotations in generated C code (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by rsc
Modified:
12 years, 5 months ago
Reviewers:
CC:
golang-dev, iant
Visibility:
Public.

Description

cmd/cgo: fix line number annotations in generated C code The old version was using go/ast's CommentGroup.Text method, but that method drops leading blank lines from the result, so that if the comment looked like one of // // syntax error import "C" /* syntax error */ import "C" then the line numbers for the syntax error would be off by the number of leading blank lines (1 in each of the above cases). The new text extractor preserves blank lines. Fixes issue 4019.

Patch Set 1 #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -1 line) Patch
M src/cmd/cgo/ast.go View 1 2 chunks +25 lines, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 5 months ago (2013-02-01 06:04:38 UTC) #1
iant
LGTM
12 years, 5 months ago (2013-02-01 15:19:57 UTC) #2
rsc
12 years, 5 months ago (2013-02-01 16:34:06 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=3686735a3658 ***

cmd/cgo: fix line number annotations in generated C code

The old version was using go/ast's CommentGroup.Text method,
but that method drops leading blank lines from the result, so that
if the comment looked like one of

//
// syntax error
import "C"

/*
syntax error
*/
import "C"

then the line numbers for the syntax error would be off by the
number of leading blank lines (1 in each of the above cases).

The new text extractor preserves blank lines.

Fixes issue 4019.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7232071
Sign in to reply to this message.

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