extractVariable — the swift top-level branch (:2851): let → constant / var → variable via swiftPropertyInfo; computed skipped; position = the whole declaration; extras = docstring + isExported literal FALSE.
(&mut self, node: Node<'t>)
| 1002 | /// var → variable via swiftPropertyInfo; computed skipped; position = the |
| 1003 | /// whole declaration; extras = docstring + isExported literal FALSE. |
| 1004 | fn extract_variable(&mut self, node: Node<'t>) { |
| 1005 | let docstring = preceding_docstring(node, self.src); |
| 1006 | let info = self.swift_property_info(node); |
| 1007 | let Some(name_node) = info.name_node else { return }; |
| 1008 | if info.is_computed { |
| 1009 | return; |
| 1010 | } |
| 1011 | let kind: &'static str = if info.is_let { "constant" } else { "variable" }; |
| 1012 | let name = self.text(name_node).to_string(); |
| 1013 | self.create_node( |
| 1014 | kind, |
| 1015 | &name, |
| 1016 | node, |
| 1017 | Extra { docstring, is_exported: Some(false), ..Extra::default() }, |
| 1018 | ); |
| 1019 | } |
| 1020 | |
| 1021 | fn extract_import(&mut self, node: Node<'t>) { |
| 1022 | let import_text = self.text(node).trim().to_string(); |
no test coverage detected