]> Cypherpunks repositories - gostls13.git/commit
go/ast, go/printer: recognize export and extern line directives
authorRuss Cox <rsc@golang.org>
Mon, 11 Apr 2022 21:19:09 +0000 (17:19 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 11 Apr 2022 22:03:44 +0000 (22:03 +0000)
commit0605bf6052807e71e52fc3864b18b221ce61b047
treed1929a1f972a68181ef66d881442639bc71738d7
parent19309779ac5e2f5a2fd3cbb34421dafb2855ac21
go/ast, go/printer: recognize export and extern line directives

Now that gofmt is reformatting these, we can't get away with
not knowing about directives such as //export and //extern (for gccgo).
Otherwise "//export foo" and "//extern foo" turn into "// export foo",
and "// extern foo", which are completely different meanings.

For #51082.

Change-Id: Id0970331fa0b52ab5fa621631b5fa460767068bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/399734
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/go/ast/ast.go
src/go/ast/ast_test.go
src/go/printer/comment.go
src/go/printer/testdata/comments.golden
src/go/printer/testdata/comments.input