Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 470 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 470 Bytes

ast-grep napi language for swift

Installation

In a pnpm project, run:

pnpm install @ast-grep/lang-swift
pnpm install @ast-grep/napi
# install the tree-sitter-cli if no prebuild is available
pnpm install @tree-sitter/cli --save-dev

Usage

import swift from '@ast-grep/lang-swift'
import { registerDynamicLanguage, parse } from '@ast-grep/napi'

registerDynamicLanguage({ swift })

const sg = parse('swift', `your code`)
sg.root().kind()