# swift_parser.py

**Path:** `src/thedoc/parsers/swift_parser.py`

## Classes

### SwiftParser

Parser for Swift documentation comments.

---

## Methods

### SwiftParser.__init__

Initialize the parser.

```python
__init__(self, root_path)
```

---

### SwiftParser.get_file_extensions

Get Swift file extensions.

```python
get_file_extensions(self)
```

---

### SwiftParser.parse_file

Parse a Swift source file and extract documentation.

```python
parse_file(self, file_path)
```

**Parameters:**

* `file_path`: Path to the source file

---

### SwiftParser._parse_file_to_dict

Parse a Swift source file and extract documentation as a dictionary.

```python
_parse_file_to_dict(self, file_path)
```

**Parameters:**

* `file_path`: Path to the source file

---

### SwiftParser._process_doc_block

Process a documentation block and its associated code line.

```python
_process_doc_block(self, doc_text, code_line, documentation)
```

**Parameters:**

* `doc_text`: The documentation text
* `code_line`: The associated code line
* `documentation`: The documentation dictionary to update

---

### SwiftParser._parse_doc_block

Parse a documentation block.

```python
_parse_doc_block(self, doc_text)
```

**Parameters:**

* `doc_text`: The documentation text to parse

---

### SwiftParser._parse_tags

Parse documentation tags and add them to the doc block.

```python
_parse_tags(self, tags_text, doc_block)
```

**Parameters:**

* `tags_text`: The text containing the tags
* `doc_block`: The documentation block to update

---

### SwiftParser._detect_code_element

Detect the type of Swift code element and its name.

```python
_detect_code_element(self, code_line)
```

**Parameters:**

* `code_line`: The line of code following the doc comment

---

### SwiftParser._clean_description

Clean up the description text by removing comment markers and extra whitespace.

```python
_clean_description(self, text)
```

**Parameters:**

* `text`: The description text to clean

---

## Modules

### swift_parser

Parser for Swift documentation comments.

---

