Extract a comment from a line node, if the line is purely a comment. Returns the comment text (with leading ' stripped), or None if not a comment line.
(state: &ExtractionState, line: TsNode<'_>)
| 186 | /// Extract a comment from a line node, if the line is purely a comment. |
| 187 | /// Returns the comment text (with leading ' stripped), or None if not a comment line. |
| 188 | fn extract_line_comment(state: &ExtractionState, line: TsNode<'_>) -> Option<String> { |
| 189 | let stmt_list = find_direct_child_by_kind(line, "statement_list")?; |
| 190 | let stmt = find_direct_child_by_kind(stmt_list, "statement")?; |
| 191 | let comment = find_direct_child_by_kind(stmt, "apostrophe_comment")?; |
| 192 | let text = state.node_text(comment); |
| 193 | // Strip leading ' and whitespace. |
| 194 | let stripped = text.trim_start_matches('\'').trim().to_string(); |
| 195 | Some(stripped) |
| 196 | } |
| 197 | |
| 198 | /// Visit a top-level `line` node, extracting CONST, DIM SHARED, CALL, etc. |
| 199 | fn visit_line(state: &mut ExtractionState, line: TsNode<'_>, pending_comment: Option<&str>) { |
nothing calls this directly
no test coverage detected