{"by":"daspoon","descendants":10,"id":41301777,"kids":[41303144,41303775,41302960],"score":52,"text":"I have created a Swift package (<a href=\"https:&#x2F;&#x2F;github.com&#x2F;daspoon&#x2F;tree-sitter-kit\">https:&#x2F;&#x2F;github.com&#x2F;daspoon&#x2F;tree-sitter-kit</a>) enabling tree-sitter parsers to be written in Swift; specifically, as an array of production rules which map symbol types to pairings of syntax expression and type constructor. A member macro derives a tree-sitter grammar and embeds the generated parser in its expansion.<p>This project is a work in progress, and I will be grateful for any feedback.<p>Thanks,\nDave","time":1724173381,"title":"Show HN: Tree-sitter Integration for Swift","type":"story","url":"https://github.com/daspoon/tree-sitter-kit"}