Skip to content

Commit

Permalink
Move parser information to tree-sitter.json (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Dec 9, 2024
1 parent a78952c commit d6fd707
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 20 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
"url": "https://github.com/elixir-lang/tree-sitter-elixir.git"
},
"scripts": {
"build": "tree-sitter generate --no-bindings",
"build": "tree-sitter generate",
"test": "tree-sitter test",
"format": "prettier --trailing-comma es5 --write grammar.js && clang-format -i src/scanner.c",
"format-check": "prettier --trailing-comma es5 --check grammar.js && cat src/scanner.c | clang-format src/scanner.c | diff src/scanner.c -",
"install": "node-gyp-build",
"prebuildify": "prebuildify --napi --strip"
"prestart": "tree-sitter build --wasm",
"start": "tree-sitter playground"
},
"dependencies": {
"node-addon-api": "^7.1.0",
Expand All @@ -38,19 +39,10 @@
"devDependencies": {
"clang-format": "^1.8.0",
"prettier": "^2.3.2",
"tree-sitter-cli": "^0.23.0",
"tree-sitter-cli": "^0.24.0",
"prebuildify": "^6.0.0"
},
"peerDependencies": {
"tree-sitter": "^0.21.0"
},
"tree-sitter": [
{
"scope": "source.elixir",
"file-types": ["ex", "exs"],
"highlights": ["queries/highlights.scm"],
"tags": ["queries/tags.scm"],
"injection-regex": "^(ex|elixir)$"
}
]
}
}
40 changes: 40 additions & 0 deletions tree-sitter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"grammars": [
{
"name": "elixir",
"camelcase": "Elixir",
"scope": "source.elixir",
"path": ".",
"file-types": ["ex", "exs"],
"highlights": "queries/highlights.scm",
"tags": "queries/tags.scm",
"injection-regex": "^(ex|elixir)$"
}
],
"metadata": {
"version": "0.3.2",
"license": "Apache-2.0",
"description": "Elixir grammar for the tree-sitter parsing library",
"authors": [
{
"name": "Jonatan Kłosko",
"email": "[email protected]"
},
{
"name": "Michael Davis",
"email": "[email protected]"
}
],
"links": {
"repository": "https://github.com/elixir-lang/tree-sitter-elixir"
}
},
"bindings": {
"c": true,
"go": true,
"node": true,
"python": true,
"rust": true,
"swift": true
}
}

0 comments on commit d6fd707

Please sign in to comment.