Commit 2bce391
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 911b122 commit 2bce391
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 | |
|---|---|---|---|
| |||
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
2331 | 2357 | | |
2332 | 2358 | | |
2333 | 2359 | | |
| |||
0 commit comments