tree-sitter-mal


Nametree-sitter-mal JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryIT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technology.
upload_time2025-07-20 14:17:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords incremental parsing tree-sitter mal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tree-sitter-mal

MAL grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).

References
- [MAL Wiki](https://github.com/mal-lang/mal-documentation/wiki)
  - [MAL Syntax](https://github.com/mal-lang/mal-documentation/wiki/MAL-Syntax)
- [MAL Compiler Wiki](https://github.com/mal-lang/malcompiler/wiki/)
  - [MAL Language Specification](https://github.com/mal-lang/malcompiler/wiki/MAL-language-specification)
- [MAL Grammar Implementation](https://github.com/mal-lang/mal-toolbox/blob/main/maltoolbox/language/compiler/mal.g4)
- [MAL Vim Syntax Highlighting](https://github.com/nkakouros-original/mal.vim)

## Usage
[Install tree sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) 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`](https://tree-sitter.github.io/tree-sitter/cli/parse.html).

To use the highlight through the command line, make sure you have a [config file initialized](https://tree-sitter.github.io/tree-sitter/cli/init-config.html). 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](https://tree-sitter.github.io/tree-sitter/cli/highlight.html) for more information.

For more commands see [tree sitter CLI docs](https://tree-sitter.github.io/tree-sitter/cli/index.html).

### NeoVim Manual Installation
> [!NOTE]
> Tested for NeoVim v0.11.1.

#### Using [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md#adding-parsers)

1. Install the grammar. Simply add the following Lua snippet to your configuration (`init.lua` or respective package config)
    ```lua
    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",
        },
    })
    ```
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:
    ```lua
    vim.api.nvim_create_autocmd( 'FileType', { pattern = 'mal',
        callback = function(args)
            vim.treesitter.start(args.buf, 'mal')
        end
    })
    ```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tree-sitter-mal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "incremental, parsing, tree-sitter, mal",
    "author": null,
    "author_email": "Andreas Hammarstrand <andreas.hammarstrand@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/37/65/ffc2fa0e62e6b29b2da98059beaebac6e14a117d51a1c6889b83bfae7555/tree_sitter_mal-1.0.1.tar.gz",
    "platform": null,
    "description": "# tree-sitter-mal\n\nMAL grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\nReferences\n- [MAL Wiki](https://github.com/mal-lang/mal-documentation/wiki)\n  - [MAL Syntax](https://github.com/mal-lang/mal-documentation/wiki/MAL-Syntax)\n- [MAL Compiler Wiki](https://github.com/mal-lang/malcompiler/wiki/)\n  - [MAL Language Specification](https://github.com/mal-lang/malcompiler/wiki/MAL-language-specification)\n- [MAL Grammar Implementation](https://github.com/mal-lang/mal-toolbox/blob/main/maltoolbox/language/compiler/mal.g4)\n- [MAL Vim Syntax Highlighting](https://github.com/nkakouros-original/mal.vim)\n\n## Usage\n[Install tree sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) 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.\n\nTo see the parse tree the parser generates, use the command [`tree-sitter parse`](https://tree-sitter.github.io/tree-sitter/cli/parse.html).\n\nTo use the highlight through the command line, make sure you have a [config file initialized](https://tree-sitter.github.io/tree-sitter/cli/init-config.html). 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](https://tree-sitter.github.io/tree-sitter/cli/highlight.html) for more information.\n\nFor more commands see [tree sitter CLI docs](https://tree-sitter.github.io/tree-sitter/cli/index.html).\n\n### NeoVim Manual Installation\n> [!NOTE]\n> Tested for NeoVim v0.11.1.\n\n#### Using [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md#adding-parsers)\n\n1. Install the grammar. Simply add the following Lua snippet to your configuration (`init.lua` or respective package config)\n    ```lua\n    local parser_config = require \"nvim-treesitter.parsers\".get_parser_configs()\n    parser_config.mal = {\n      install_info = {\n        url = \"https://github.com/Tobiky/tree-sitter-mal\", -- local path or git repo\n        files = {\"src/parser.c\"},\n        branch = \"main\",\n        generate_requires_npm = false,\n        requires_generate_from_grammar = false,\n      },\n      filetype = \"mal\",\n    }\n    vim.filetype.add({\n        extension = {\n            mal = \"mal\",\n        },\n    })\n    ```\n2. 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/`).\n3. Verify that everything is installed by running a healthcheck `:checkhealth nvim-treesitter`, the table will list if the grammar and highlighting has been found.\n4. Configure Nvim to start tree-sitter. Here is an example using auto-commands:\n    ```lua\n    vim.api.nvim_create_autocmd( 'FileType', { pattern = 'mal',\n        callback = function(args)\n            vim.treesitter.start(args.buf, 'mal')\n        end\n    })\n    ```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technology.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/tobiky/tree-sitter-mal"
    },
    "split_keywords": [
        "incremental",
        " parsing",
        " tree-sitter",
        " mal"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0d2a4585dfd1c48cca0143e8f75cb92619c529e3120d568c2c9391ef16c14dda",
                "md5": "80a9a1032a540190b311641b6add6a3c",
                "sha256": "2f42fc51350be7aacb269b1e24d0e907ee694651b06620a85d8b0c612331db10"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "80a9a1032a540190b311641b6add6a3c",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 18188,
            "upload_time": "2025-07-20T14:17:42",
            "upload_time_iso_8601": "2025-07-20T14:17:42.736145Z",
            "url": "https://files.pythonhosted.org/packages/0d/2a/4585dfd1c48cca0143e8f75cb92619c529e3120d568c2c9391ef16c14dda/tree_sitter_mal-1.0.1-cp39-abi3-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ee8233128a9557409de06633c7662430abaea0c8ad512cc6d94bf28366ec82f3",
                "md5": "f6584bfbda53411865a63c20c9180f9d",
                "sha256": "3606abf5e6697d2a0564f64002c7e6df3e5d3ede044ae692c5e59bfdd5abdf44"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "f6584bfbda53411865a63c20c9180f9d",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 18834,
            "upload_time": "2025-07-20T14:17:43",
            "upload_time_iso_8601": "2025-07-20T14:17:43.723988Z",
            "url": "https://files.pythonhosted.org/packages/ee/82/33128a9557409de06633c7662430abaea0c8ad512cc6d94bf28366ec82f3/tree_sitter_mal-1.0.1-cp39-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "50ecb571b58c4433b4936ab1c70da8a9fb8b954f49f1e82b775f9403ea7b6597",
                "md5": "b0662040bd77762de395f298aa162df9",
                "sha256": "0d3b56c738c71f176a18a65ff7616a1cc9b4ee851b3f5594c30545cc563767f0"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "b0662040bd77762de395f298aa162df9",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 32221,
            "upload_time": "2025-07-20T14:17:44",
            "upload_time_iso_8601": "2025-07-20T14:17:44.502422Z",
            "url": "https://files.pythonhosted.org/packages/50/ec/b571b58c4433b4936ab1c70da8a9fb8b954f49f1e82b775f9403ea7b6597/tree_sitter_mal-1.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7a649b57113c55d9a02d99d231e5d50c2de17a56981adc2a2a5b37853962fe24",
                "md5": "cfa1438da924637fc71bd4c8eb304024",
                "sha256": "3392671cfa0182d02a48f5c96d1d43a0eb7bfb195aef813ed13870c8d289498b"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "cfa1438da924637fc71bd4c8eb304024",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 32285,
            "upload_time": "2025-07-20T14:17:45",
            "upload_time_iso_8601": "2025-07-20T14:17:45.305197Z",
            "url": "https://files.pythonhosted.org/packages/7a/64/9b57113c55d9a02d99d231e5d50c2de17a56981adc2a2a5b37853962fe24/tree_sitter_mal-1.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bf47a0200f2539cbff029644597248f16645bf4852d20a5ffdc074823dcb41ee",
                "md5": "9f1461c7992e5d65a62f211fae9cb948",
                "sha256": "31628e24f2b27e52343587a6540fc379fc6506913944165e0564dfece5b5558e"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "9f1461c7992e5d65a62f211fae9cb948",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 30421,
            "upload_time": "2025-07-20T14:17:46",
            "upload_time_iso_8601": "2025-07-20T14:17:46.057903Z",
            "url": "https://files.pythonhosted.org/packages/bf/47/a0200f2539cbff029644597248f16645bf4852d20a5ffdc074823dcb41ee/tree_sitter_mal-1.0.1-cp39-abi3-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a840c5c8244034d7f5cb63d90499c4956f5e1717879e3b85ce519b84ace96c5b",
                "md5": "421422561b7114f7778f688ca871ad18",
                "sha256": "d3cd02e8d4accfc57c66285925e9c8fb454b38f938dfe0b7cd197af3f2b81d5b"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "421422561b7114f7778f688ca871ad18",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 21118,
            "upload_time": "2025-07-20T14:17:46",
            "upload_time_iso_8601": "2025-07-20T14:17:46.827693Z",
            "url": "https://files.pythonhosted.org/packages/a8/40/c5c8244034d7f5cb63d90499c4956f5e1717879e3b85ce519b84ace96c5b/tree_sitter_mal-1.0.1-cp39-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ad12fbd5cbc2ed1ccc585cad0062871650f4a81b1a0f34df5b4f6d330d940a39",
                "md5": "458333b1101cf876fe7d701a10b78370",
                "sha256": "8cc3c2ce9963e929b5f26a1aeb86e851a8db192803a02260c58bbbdf1337f5e1"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1-cp39-abi3-win_arm64.whl",
            "has_sig": false,
            "md5_digest": "458333b1101cf876fe7d701a10b78370",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 19890,
            "upload_time": "2025-07-20T14:17:48",
            "upload_time_iso_8601": "2025-07-20T14:17:48.652297Z",
            "url": "https://files.pythonhosted.org/packages/ad/12/fbd5cbc2ed1ccc585cad0062871650f4a81b1a0f34df5b4f6d330d940a39/tree_sitter_mal-1.0.1-cp39-abi3-win_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3765ffc2fa0e62e6b29b2da98059beaebac6e14a117d51a1c6889b83bfae7555",
                "md5": "2efb259da8ea10179c41c6ebef42efb4",
                "sha256": "29af6c7f4ae5a948aea9f0f4836e5eae29547b29ba92a60b21b3b37ed445c000"
            },
            "downloads": -1,
            "filename": "tree_sitter_mal-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2efb259da8ea10179c41c6ebef42efb4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 26475,
            "upload_time": "2025-07-20T14:17:49",
            "upload_time_iso_8601": "2025-07-20T14:17:49.469987Z",
            "url": "https://files.pythonhosted.org/packages/37/65/ffc2fa0e62e6b29b2da98059beaebac6e14a117d51a1c6889b83bfae7555/tree_sitter_mal-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 14:17:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tobiky",
    "github_project": "tree-sitter-mal",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tree-sitter-mal"
}
        
Elapsed time: 0.58602s