Tree-sitter for the latest version of Minecraft mcfunction syntax
Project description
Tree-sitter for MCFunction
Tree-sitter grammar for Minecraft 1.21.11+ data pack function language.
If you have any issues with parsing/highlighting, feel free to create an issue.
Neovim installation
Using lazy:
return {
"bbfh-dev/tree-sitter-mcfunction",
config = function()
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.mcfunction = {
install_info = {
url = "https://github.com/bbfh-dev/tree-sitter-mcfunction",
files = { "src/parser.c" },
branch = "main",
generate_requires_npm = false, -- stand-alone parser without npm dependencies
requires_generate_from_grammar = false, -- folder contains pre-generated src/parser.c
queries = "queries/mcfunction",
},
}
vim.filetype.add({
extension = {
mcfunction = "mcfunction",
},
})
end,
}
If needed, run: :TSInstall mcfunction.
Other editors
Refer to your editor's documentation on custom tree-sitter grammars.
I do not use other text editors, but I will happily accept contributions for plugins/add-ons/extensions that enable this grammar in a different editor.
Addendum
1 Macros
This grammar accepts $(macro)-s in many common places. However, some $(macro) tricks simply cannot be properly handled and can lead to errors.
2 Testing
[!IMPORTANT] Quantity ≠ quality. I used all projects I could scramble on my machine, but that does not mean that all possible syntax is covered.
Alongside tree-sitter tests, the grammar was tested on at least 19,293 files (~146,314 lines) worth of mcfunction code.
The script used can be found in this repository: test_local_files.sh. (Note: the script is sloppy, I did not intend for it to even be public)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tree_sitter_mcfunction-0.3.9.tar.gz.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9.tar.gz
- Upload date:
- Size: 189.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81549812dfa1ee64defa75a4b41013a5335f1fd0a9014dcc7fc1339b5b6ec9b7
|
|
| MD5 |
bbe6a0b4ecc6290308be10f7399094a2
|
|
| BLAKE2b-256 |
6134aa864092edf006974d99b0d598e671dca9d72ec8aaee447e512e9f38682e
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-win_arm64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-win_arm64.whl
- Upload date:
- Size: 67.9 kB
- Tags: CPython 3.10+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a67e9147facf99ee3e97f31e0ac13f385e10ae61f0b363fa1122d03d2c142b5
|
|
| MD5 |
555cac5f503683ddecaf0c0cabc6b2d3
|
|
| BLAKE2b-256 |
eb2f111949a63707a9817932d7cb5a4475d7a44b9c3121ef394086b7e3a16e69
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 70.9 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
822443c27ce690f8066210df48a5273cedfc6c6a1e4990959e854ea78cd73930
|
|
| MD5 |
b290b91a1bca9fbfe96fbf57b9e54689
|
|
| BLAKE2b-256 |
66fb50e352dff7b5a81493d85d68776577eaf27f76d5b8f3a4ead39bf5e49220
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 80.5 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0c6dd2d60e3301731907fe15e9f8e340d79d0be463915231df74e84d410bdff
|
|
| MD5 |
c0d122bcbc4789caee35092482b9b388
|
|
| BLAKE2b-256 |
126215ed42ffd67d2da1dd36c07ae792513d4c352aaf7c9e4cd3fe98d9751f3f
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 79.3 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a60d56714fde75aef17099f8c777aeb1661fad244c41983913108f598aa8272
|
|
| MD5 |
2afad7a7d8dd94b9bfe7a6229c667254
|
|
| BLAKE2b-256 |
66d11ac950cb136430e13a62c34d69dbfd207f9fff6c9be9a26b90719d0045c9
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 79.9 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26e745f800128d923baa8833e98c630798e5e90c84799cce6b6034a989c4b77f
|
|
| MD5 |
e58bbe9f5766b6699fa4d634e26b529a
|
|
| BLAKE2b-256 |
7310b36c796e0ef71314f12110cb7ad5370324d76d30e0e21a3ab5eb9287cd45
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 81.2 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
267dd480e80b9a82c4da5dad547f0f326896b361f39acd366cd8c9643be4f19a
|
|
| MD5 |
612197a58835b251c7222e71248d306f
|
|
| BLAKE2b-256 |
c78c7d1c0945730f9c50a62647f5f924336b919022ed330cf893692b16149259
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 70.7 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
274bef9e44242a9802b2e78cc35d8497ba0b32a1a7d59e2c0227c6da0bcae852
|
|
| MD5 |
7c1c8cfb84a86ae5fd6461ecdf8b51bd
|
|
| BLAKE2b-256 |
ee87f6134703c709778fa1c7117874c29a3142c3798a4449d49a6258970213ba
|
File details
Details for the file tree_sitter_mcfunction-0.3.9-cp310-abi3-macosx_10_9_x86_64.whl.
File metadata
- Download URL: tree_sitter_mcfunction-0.3.9-cp310-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 66.3 kB
- Tags: CPython 3.10+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9bd014f6c8cbd4eb0b7d427973f1e0a0b2a1f660b838d13a9d7aabf2bb6dfb9
|
|
| MD5 |
a9b0ca1a4860be025f5544f5a3d877b1
|
|
| BLAKE2b-256 |
d96d4c46c962a47000adb15c87f00a8ea1bff96416c47184eddedae64e821fb5
|