Tree-sitter for MCFunction
Tree-sitter grammar for modern Minecraft data pack function language. Supports 26.1 and earlier versions.
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)
Metadata
Release files for tree-sitter-mcfunction 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_mcfunction-0.4.0.tar.gz | 190.8 kB | Details |
Built distributions (wheels)
Total release size: 791.2 kB
Release files / tree_sitter_mcfunction-0.4.0.tar.gz
| Download URL | tree_sitter_mcfunction-0.4.0.tar.gz |
|---|---|
| Size | 190.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
765d3c3e6a3af6f4dcbfcdeef8535925447a2cf5c44fe5750a83d526aa6bba77
|
|
BLAKE2b-256 checksum How to use checksums |
8ee13c41f77ec36e6814be73dbacb5e9a8548db55b3a5c49f5490f9d8015e2d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-win_arm64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 68.3 kB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4ffb738686815a57765bf53031b0531ae3b79f802957fd730445e3b610493201
|
|
BLAKE2b-256 checksum How to use checksums |
22303278050931a58c1441d9e34a2a3a7a6d2cf08c3e4e9f00ac9b66930f1cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-win_amd64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 71.3 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a8dbb292bab91e2bee1adba7212b8e03a620863a4130fcd556d28b64400a5f61
|
|
BLAKE2b-256 checksum How to use checksums |
a87866425ae7a9cdef727474e17970bfc5927277ace8c665760447fd174be3d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 81.0 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
64e296d766c5b1a40e48b8988e56812b87da2e66d20ee6af98ff228b40a3c602
|
|
BLAKE2b-256 checksum How to use checksums |
9dfa235802b5df9ef0d75231c65e16da1ed8d0c241c2b7e3f2481eddff53d7f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 79.8 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f4f3b437380ce1ca03b9e749d6e518ce0d08ccfda96a00484e0f17afbbd240d3
|
|
BLAKE2b-256 checksum How to use checksums |
5d7016bd1906e7d80e6b0d464b4369b18d393c54655689376ce048ca5db64fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 80.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1b36d6a580daffbbbb5a47ee23622d6465d6e7af4aab47d2cd7f3e803a22f434
|
|
BLAKE2b-256 checksum How to use checksums |
b770c04541d6ee0e1108c2a048956bb04766f731641c0f035742b754fdaf4e05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 81.8 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5d390b7d059f168a9648fd054e0a919d482c7097c31d954e6cef34c29f10a463
|
|
BLAKE2b-256 checksum How to use checksums |
add051521f43b96f906d530cf2e45e146a0c4d874cc1eb3996eefc576e622365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 71.1 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5f6d8995ebe5090e38092984549c82484a3c9a43c6c21bc4b19f59a5d8f01eab
|
|
BLAKE2b-256 checksum How to use checksums |
9b8c0bf121b5d911ca564948745752d021c03aae2dac94d970f1fdce270ca5f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_mcfunction-0.4.0-cp310-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_mcfunction-0.4.0-cp310-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 66.7 kB |
| Tags | CPython 3.10 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
dc17bc87e09235089a227e0951b5298486ccf922699cd7f3a67d4a8853b821b3
|
|
BLAKE2b-256 checksum How to use checksums |
03d54f9a4ccea9c3f28b35719e596c526989e65a6fc20e5c47606ceca88980d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|