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

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/mal-lang/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
    })
    

Metadata

Release files for tree-sitter-mal 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-mal 1.3.1
File Size Uploaded
tree_sitter_mal-1.3.1.tar.gz 63.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-mal 1.3.1
File
tree_sitter_mal-1.3.1-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
tree_sitter_mal-1.3.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
tree_sitter_mal-1.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details
tree_sitter_mal-1.3.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.5+ x86-64 Details
tree_sitter_mal-1.3.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
tree_sitter_mal-1.3.1-cp39-abi3-macosx_10_9_x86_64.whl CPython 3.9 abi3 macOS 10.9+ x86-64 Details

Total release size: 397.5 kB

Release files / tree_sitter_mal-1.3.1.tar.gz

Download URL tree_sitter_mal-1.3.1.tar.gz
Size 63.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7e5f2334fd8075ea4ce2baa85a7a890a3c6ec99c4a03f1b87e73910ca5863e7f
BLAKE2b-256 checksum
How to use checksums
7a6307b018842f71c23ea9519ad08ad2c6ab91774726007ff3a23af28251f8e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-win_arm64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-win_arm64.whl
Size 36.3 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
5cf3447e0b7d579830f11c3b0d5ddc98c1f4bb9550f47d96c673ef10dfe87558
BLAKE2b-256 checksum
How to use checksums
2472bd815589306d78f1f3a1390c228f524c45b8b5867dbdc9dccdec3fd07304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-win_amd64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-win_amd64.whl
Size 36.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
bd63972cc4c8f5a88dd650b0e8a2d588858a12b928d129e7e91f0667e7fc2817
BLAKE2b-256 checksum
How to use checksums
24dd180ce6fdfb2ca86b91cc06fbf9ecc468538b53a6bddd5f2767603b969f7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 46.6 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
bed509015f923ae1841f5fbe3184a67a5ff7449806f77abdca569d968afe285b
BLAKE2b-256 checksum
How to use checksums
cf3c84484125af45ebb41b59ff60e66cef13ba135d7d627ffb1dffd81d182940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 48.8 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e4ca46e52ecfe3d2982c8db4cc130e09702251dcf0eb1a2cdedf4813153f888f
BLAKE2b-256 checksum
How to use checksums
5ff670ddbdc1a74349dbd98fdf39ec275310050208a0c74b680a6fb632bf72fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 49.6 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
8a44097103891e4422566a73580d3792aa2057e86ee18fe573a9136cbedd8059
BLAKE2b-256 checksum
How to use checksums
545bc1a9953a6041cda411d60e382b67737f78e19d81a3e7d81117d01a4cba72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 46.8 kB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
eaf5e1bd0eb74e49ab0c0bf6221b097e56e4a70f7c2f73dd37a4706ae5541141
BLAKE2b-256 checksum
How to use checksums
acea4b19930b1cfd860ca2cf43527afdff93b7671d7db4f62290da7790d2f1c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-macosx_11_0_arm64.whl
Size 35.0 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dae334c8971a5ce84e08f8a657496f305cec21c6afab20d7aa869c960fbd2e30
BLAKE2b-256 checksum
How to use checksums
49bc090a24cdaf7cd11e0f42efbe93f514f75027a62573acfcd42079eca5db72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_mal-1.3.1-cp39-abi3-macosx_10_9_x86_64.whl

Download URL tree_sitter_mal-1.3.1-cp39-abi3-macosx_10_9_x86_64.whl
Size 33.9 kB
Tags CPython 3.9 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d07b0bfcc2039e3b3595dbacef8ec0b64acd13b58f7cfdc097cb2607cec65b47
BLAKE2b-256 checksum
How to use checksums
a5d81f21769cc56d15a8ce52511e719ed553198a9f3fde639a28cdc1c1c1661d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.3.1 This release

9 release files

1.3.0

9 release files

1.2.4

9 release files

1.2.3

9 release files

1.2.2

9 release files

1.2.1

9 release files

1.2.0

9 release files

1.0.3

9 release files

1.0.2

9 release files

1.0.1

8 release files

1.0.0

8 release 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