Extracting ranges of simple statements using SourceKit

Hi all,

I’m working on a static program slicer for Swift for a research project.

Given a source file, I need to extract the ranges of all simple statements (e.g `var x = 1`, `print(“hello”)`, `break`) and of the control flow structures. Thus far, I’ve been trying to do this using SourceKit (via SourceKitten).

The `index` call to SourceKit (and the structure call to SourceKitten) seems to give me a good summary of the control flow structure but not the simple statements or unstructured control flow statements like `continue` or `break`.

I wonder if anybody could point me in the right direction to extracting the ranges of these things.

Jared Khan