File | File | |
| | @@ -1,9 +1,31 @@
|
1 | 1 | Parent: b1254a4 (remove comment about API being undecided)
|
2 | 2 | Author: Dmitri Shuralyov <dmitri@shuralyov.com>
|
3 | 3 | AuthorDate: Mon Jun 21 00:40:49 2021 -0400
|
4 | 4 | Commit: Dmitri Shuralyov <dmitri@shuralyov.com>
|
5 | | CommitDate: Sun Aug 1 13:54:44 2021 -0400
|
| 5 | CommitDate: Sun Dec 12 15:01:05 2021 -0500
|
6 | 6 |
|
7 | 7 | update implementation for 2020 spec changes
|
8 | 8 |
|
| 9 | With the new specification, it's possible to stop reading a file early
|
| 10 | even when the generated comment is absent, since the generated comment
|
| 11 | may no longer appear anywhere in the file. Begin parsing /* */ comment
|
| 12 | blocks, which may span multiple lines, to be able to be able to detect
|
| 13 | when we run into the first non-comment, non-blank text in the file.
|
| 14 |
|
| 15 | It was mentioned in https://go.dev/issue/41196#issuecomment-686607452:
|
| 16 |
|
| 17 | > [...] the primary focus for these comments is Go code
|
| 18 | > and more generally Go package sources.
|
| 19 | > Go package sources today can be Go, assembly, C, C++, Objective C,
|
| 20 | > SWIG, and Fortran.
|
| 21 | > The comment being discussed here, like the //go:build comment,
|
| 22 | > handles all of these these except Fortran, which seems fine.
|
| 23 |
|
| 24 | The initial scope of this package was to support parsing Go source only,
|
| 25 | but it happens to work well with many other source types that are found
|
| 26 | in Go packages. Replace mentions of "a Go source file" in documentation
|
| 27 | and code with "a source file", to make it apply more generally. If this
|
| 28 | will mean we need to parse comments differently depending on the source
|
| 29 | type in the future, we can revisit this decision. Let's see how it goes.
|
| 30 |
|
9 | 31 | Fixes issue 1.
|
Should capitalize sentence :P