Commit 95e5642
fix: preserve block comments as single nodes for gogen v1.20.2 compatibility
The gogen v1.20.2 update exposed an issue where multi-line C block
comments (/* ... */) were being incorrectly split into multiple Go AST
Comment nodes. This created invalid Go syntax because each Comment node
in Go's AST must be self-contained (either a complete // line or a
complete /* */ block).
Fixed ParseComment() to:
- Keep /* */ block comments as a single Comment node
- Preserve existing behavior for // line comments
Fixes test failures in:
- TestFromTestdata/gettext
- TestFromTestdata/gpgerror
- TestFromTestdata/issue507
- TestFromTestdata/keepcomment
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>1 parent 5bf65f1 commit 95e5642
1 file changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
198 | 213 | | |
199 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
| |||
0 commit comments