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>)
| 1026 | /// var → variable via swiftPropertyInfo; computed skipped; position = the |
| 1027 | /// whole declaration; extras = docstring + isExported literal FALSE. |
| 1028 | fn extract_variable(&mut self, node: Node<'t>) { |
| 1029 | let docstring = preceding_docstring(node, self.src); |
| 1030 | let info = self.swift_property_info(node); |
| 1031 | let Some(name_node) = info.name_node else { return }; |
| 1032 | if info.is_computed { |
| 1033 | return; |
| 1034 | } |
| 1035 | let kind: &'static str = if info.is_let { "constant" } else { "variable" }; |
| 1036 | let name = self.text(name_node).to_string(); |
| 1037 | self.create_node( |
| 1038 | kind, |
| 1039 | &name, |
| 1040 | node, |
| 1041 | Extra { docstring, is_exported: Some(false), ..Extra::default() }, |
| 1042 | ); |
| 1043 | } |
| 1044 | |
| 1045 | fn extract_import(&mut self, node: Node<'t>) { |
| 1046 | let import_text = self.text(node).trim().to_string(); |
no test coverage detected