Skip to main content

tree-sitter-mal

MAL grammar for tree-sitter. Used in the MAL-toolbox to parse MAL languages.

References

Usage

Install tree sitter CLI to be able to use this grammar. Then, run tree-sitter generate to generate the parser from the grammar and tree-sitter test to test the parser, as well as the syntax highlighting and code navigation queries.

To see the parse tree the parser generates, use the command tree-sitter parse.

To use the highlight through the command line, make sure you have a config file initialized. Then, you can use your own highlighting colors or copy the ones in the repository, specialized for MAL. Lastly, use tree-sitter highlight to generate an output, see the docs for more information.

For more commands see tree sitter CLI docs and the tree-sitter-mal Wiki.

Playground

You can play around with the grammar and see the parse tree in your browser using the tree-sitter playground. To start it, run:

tree-sitter build --wasm;tree-sitter playground

NeoVim Manual Installation

[!NOTE] Tested for NeoVim v0.11.1.

Using nvim-treesitter

  1. Install the grammar. Simply add the following Lua snippet to your configuration (init.lua or respective package config)
    local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
    parser_config.mal = {
      install_info = {
        url = "https://github.com/Tobiky/tree-sitter-mal", -- local path or git repo
        files = {"src/parser.c"},
        branch = "main",
        generate_requires_npm = false,
        requires_generate_from_grammar = false,
      },
      filetype = "mal",
    }
    vim.filetype.add({
        extension = {
            mal = "mal",
            dmal = "mal",
        },
    })
    
  2. Install the queries. Find the query installation folder (it will be in your runtime path, :h rtp). You can find various locations by using e.g. find ~ -type d -and -iname "queries" (NOTE: This example only looks at files installed in your home directory). An example of the path can be $HOME/.local/share/nvim/lazy/nvim-treesitter/ if you are using the Lazy PM. Install the files from queries into a directory named after the language (cp -r queries $NVIM_TREESITTER_QUERIES/mal/).
  3. Verify that everything is installed by running a healthcheck :checkhealth nvim-treesitter, the table will list if the grammar and highlighting has been found.
  4. Configure Nvim to start tree-sitter. Here is an example using auto-commands:
    vim.api.nvim_create_autocmd( 'FileType', { pattern = 'mal',
        callback = function(args)
            vim.treesitter.start(args.buf, 'mal')
        end
    })
    

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_mal-1.3.0.tar.gz (63.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_mal-1.3.0-cp39-abi3-win_arm64.whl (35.8 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_mal-1.3.0-cp39-abi3-win_amd64.whl (36.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl (47.1 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl (48.8 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (49.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_mal-1.3.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (47.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_mal-1.3.0-cp39-abi3-macosx_11_0_arm64.whl (34.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.3.0-cp39-abi3-macosx_10_9_x86_64.whl (33.8 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_mal-1.3.0.tar.gz.

File metadata

  • Download URL: tree_sitter_mal-1.3.0.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tree_sitter_mal-1.3.0.tar.gz
Algorithm Hash digest
SHA256 64786714ab7925b8f5f340d19ffd2da158128d58a6ae080a80d4d288b57d6aa7
MD5 cc1e51cd04424095763286d6b16660ff
BLAKE2b-256 db159aba95e87a152a93b84c9b0fb307b52e746137b6b2bb7c1a28349bd17475

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 eb3dcd7de41134267a07402f32d7df92865513f991ca7d3c6e6ea06bfb91876f
MD5 ed9c6c2836cdd30b6516bd15ae71797d
BLAKE2b-256 d50706d3bb06a6596a600ab6912fac4d05bb605dbd3533cad7624fdb54aaf61c

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dac3df91a4fbb7ca399504fa287d6c92e1ca601e89200df5076b60a078ce0ae2
MD5 04006f54b2ced73938d309c0f35db3d1
BLAKE2b-256 4d45824a62d9fc684ef4fe84214266cab2a7035c2ca287d96d736485b9c5ffd7

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1783f2e905061678b1c275f67f0a559df31923392cc48f08b681f4c57d9acf1c
MD5 54ed0c8addf616fe9ce07e54d3960e65
BLAKE2b-256 fcce995f58adf88cd2b5845ee26884f608a2c7df95a8861b3964f7bc9f8e3979

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0d456fce572f36a0e4d17aa3293c6dc7f1364138ce2558a0fb18f65fdf737036
MD5 971d64ec267f0faf0407c8c57faf7a98
BLAKE2b-256 beb9241919d2d7861006db92752d16950ccb463602c03e91413955bff94673a6

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4115677dc7d6cacbbf55eab8cf14953e3756780cb6fe000d74fffa4168105e51
MD5 39ccafbcf1097421ad942182a29176cd
BLAKE2b-256 daa4b5f0ebcd7b9fac327324de7743580b9ebe1a6dfb4a709eb94bc0a6b37485

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 eb7ebfeddf6f96d7962f4a3dcbd54273cd31a7d96983f715e79a701dbeccacf3
MD5 002359886a71fcfcc6dc9148babb77af
BLAKE2b-256 b117d67850adf8ccb2ee441c07b1545ff2ff94819d8335c60bb615f6a7c1004c

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 529426b64dbbf24cf700a2c7303f2dc95f6593a21241f3099fb1d594ce013e66
MD5 98b67df21af00da0011e38357052e1be
BLAKE2b-256 1106b4f5e4c6ad4215175ed3e1f6be064affb22b964c9203e21eb7c67134f637

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.3.0-cp39-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.3.0-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6e96e8b832d790ddcd7f1958583e99e58ed2d0d719f8281a316900f57f7a915
MD5 476134532fee5dc10bac56d793b48b5d
BLAKE2b-256 5748bc57453449275fb6ea78a6a7670d38022bba0fe1af02e8423aefe5b9539b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.0 This release

9 files

1.2.4

9 files

1.2.3

9 files

1.2.2

9 files

1.2.1

9 files

1.2.0

9 files

1.0.3

9 files

1.0.2

9 files

1.0.1

8 files

1.0.0

8 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page