Commit f14ba77
committed
tools/docgen: simplify comment_and_requirement
Simplify the logic by handling the case where `prev` is a comment that
may/may not have a feature req previous to the comment up-front.
Then, when we're looking at a `prev` that wasn't a comment, but was
`kind == expression_statement` we can recurse with `prev_prev` to handle
it as a comment that may/may not have a feature req previous to itself.
Lastly, if we know we don't have a comment and we don't have an
expression statement, try to see if we have a bare feature requirement.
We know cbindgen won't make a comment ahead of these and so can
disregard `prev_prev` for this case.1 parent 3fad732 commit f14ba77
1 file changed
+22
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | 205 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
222 | 224 | | |
223 | 225 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
| |||
0 commit comments