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>)
| 943 | /// var → variable via swiftPropertyInfo; computed skipped; position = the |
| 944 | /// whole declaration; extras = docstring + isExported literal FALSE. |
| 945 | fn extract_variable(&mut self, node: Node<'t>) { |
| 946 | let docstring = preceding_docstring(node, self.src); |
| 947 | let info = self.swift_property_info(node); |
| 948 | let Some(name_node) = info.name_node else { return }; |
| 949 | if info.is_computed { |
| 950 | return; |
| 951 | } |
| 952 | let kind: &'static str = if info.is_let { "constant" } else { "variable" }; |
| 953 | let name = self.text(name_node).to_string(); |
| 954 | self.create_node( |
| 955 | kind, |
| 956 | &name, |
| 957 | node, |
| 958 | Extra { docstring, is_exported: Some(false), ..Extra::default() }, |
| 959 | ); |
| 960 | } |
| 961 | |
| 962 | fn extract_import(&mut self, node: Node<'t>) { |
| 963 | let import_text = self.text(node).trim().to_string(); |
no test coverage detected