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