Commit ff2898f
committed
Fix :stopdoc: directive being undone for C-defined classes
After parsing, `parse_file` resets `done_documenting = false` on all
classes in `top_level.classes_or_modules`. The `done_documenting=`
setter unconditionally sets `document_self = !value`, which overrides
the `document_self = false` state set by `:stopdoc:`.
This became visible after `add_to_classes_or_modules` was added to the
C parser's `handle_class_module`, causing C-defined classes to appear
in `top_level.classes_or_modules` for the first time.
Fix by tracking when `:stopdoc:` is explicitly used via a `@stopped_doc`
flag. The `done_documenting=` setter skips the `document_self` override
when this flag is set. The flag is:
- Set only when the `:stopdoc:` directive is processed
- Cleared by `:startdoc:`
- NOT set by `suppress` (which calls `stop_doc` internally but should
remain reversible via `done_documenting = false`)1 parent e4e332f commit ff2898f
File tree
3 files changed
+35
-4
lines changed- lib/rdoc
- markup
- test/rdoc/parser
3 files changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
209 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| |||
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| 349 | + | |
346 | 350 | | |
347 | 351 | | |
348 | 352 | | |
349 | 353 | | |
350 | 354 | | |
351 | | - | |
| 355 | + | |
352 | 356 | | |
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
| 360 | + | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2292 | 2292 | | |
2293 | 2293 | | |
2294 | 2294 | | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2295 | 2321 | | |
2296 | 2322 | | |
2297 | 2323 | | |
| |||
0 commit comments