{"_id":"@acristoffers/tree-sitter-matlab","_rev":"4-dfe2831ac7c76eb32de2ecc5efc54450","name":"@acristoffers/tree-sitter-matlab","dist-tags":{"latest":"1.3.0"},"versions":{"1.2.4":{"name":"@acristoffers/tree-sitter-matlab","version":"1.2.4","keywords":["incremental","parsing","tree-sitter","matlab"],"author":{"name":"Álan Crístoffer e Sousa"},"license":"MIT","_id":"@acristoffers/tree-sitter-matlab@1.2.4","maintainers":[{"name":"acristoffers","email":"acristoffers@startmail.com"}],"homepage":"https://github.com/acristoffers/tree-sitter-matlab#readme","bugs":{"url":"https://github.com/acristoffers/tree-sitter-matlab/issues"},"dist":{"shasum":"0f268ad431fd732f44ec2df96ddf67f124a63ec1","tarball":"https://registry.npmjs.org/@acristoffers/tree-sitter-matlab/-/tree-sitter-matlab-1.2.4.tgz","fileCount":34,"integrity":"sha512-YIA0WlvhD2Fjfwvf7/kDHcIqi+7qqp05qriTW7nGCiNW/yAxSPFQQyo/sk2ZcPBC7fIxdRqXkwLaYPkKyqlk1A==","signatures":[{"sig":"MEUCIA6tWc31t0sGykwSBfqy8PzbWUVDC95w14H6GklYFlGAAiEApy0hVutPMNAZKbEEDySyHUu4NS47qIqAkK+YjiC3CjI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3736027},"main":"bindings/node","type":"commonjs","types":"bindings/node","gitHead":"febeb1a4cfdd99300d7d9fbdcb49a0158a31e363","scripts":{"test":"node --test bindings/node/*_test.js","start":"tree-sitter playground","install":"node-gyp-build","prestart":"tree-sitter build --wasm"},"_npmUser":{"name":"acristoffers","email":"acristoffers@startmail.com"},"repository":{"url":"git+https://github.com/acristoffers/tree-sitter-matlab.git","type":"git"},"_npmVersion":"10.9.3","description":"MATLAB tree-sitter parser","directories":{"test":"test"},"_nodeVersion":"22.20.0","dependencies":{"node-addon-api":"^8.2.1","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.25.3"},"peerDependencies":{"tree-sitter":"^0.21.1"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-matlab_1.2.4_1762017253904_0.030084423859686904","host":"s3://npm-registry-packages-npm-production"}},"1.2.12":{"name":"@acristoffers/tree-sitter-matlab","version":"1.2.12","keywords":["incremental","parsing","tree-sitter","matlab"],"author":{"name":"Álan Crístoffer e Sousa"},"license":"MIT","_id":"@acristoffers/tree-sitter-matlab@1.2.12","maintainers":[{"name":"acristoffers","email":"acristoffers@startmail.com"}],"homepage":"https://github.com/acristoffers/tree-sitter-matlab#readme","bugs":{"url":"https://github.com/acristoffers/tree-sitter-matlab/issues"},"dist":{"shasum":"a1588092c42817b1f1bf1db0487abdd4c2577fcb","tarball":"https://registry.npmjs.org/@acristoffers/tree-sitter-matlab/-/tree-sitter-matlab-1.2.12.tgz","fileCount":34,"integrity":"sha512-GjLUUiJeRqrCa4v3F9qAIAkA2iylrTABT9gwmRBk+9vLjko+n3AfZzULn/eQaVjrzvgOYIAJ3Dr7r+AUoBsllQ==","signatures":[{"sig":"MEYCIQDFbU6mdgUBvbVQScFKL8MLxWBbzEsbtvaDqsW+9JSrxAIhAN/0HvCu959LyUlPKo8YKmC1HkCA1L0qRl4fnUCe5U4T","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@acristoffers%2ftree-sitter-matlab@1.2.12","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":3447856},"main":"bindings/node","type":"commonjs","types":"bindings/node","gitHead":"59a0afde2646a8f52bac5e947a0ce55f470d9a7f","scripts":{"test":"node --test bindings/node/*_test.js","start":"tree-sitter playground","install":"node-gyp-build","prestart":"tree-sitter build --wasm"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8d1b4848-07f1-4d4f-a682-966e128b1af1"}},"repository":{"url":"git+https://github.com/acristoffers/tree-sitter-matlab.git","type":"git"},"_npmVersion":"11.8.0","description":"MATLAB tree-sitter parser","directories":{"test":"test"},"_nodeVersion":"20.20.0","dependencies":{"node-addon-api":"^8.2.1","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.25.3"},"peerDependencies":{"tree-sitter":"^0.21.1"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-matlab_1.2.12_1769862552928_0.8347069261426647","host":"s3://npm-registry-packages-npm-production"}},"1.2.13":{"name":"@acristoffers/tree-sitter-matlab","version":"1.2.13","keywords":["incremental","parsing","tree-sitter","matlab"],"author":{"name":"Álan Crístoffer e Sousa"},"license":"MIT","_id":"@acristoffers/tree-sitter-matlab@1.2.13","maintainers":[{"name":"acristoffers","email":"acristoffers@startmail.com"}],"homepage":"https://github.com/acristoffers/tree-sitter-matlab#readme","bugs":{"url":"https://github.com/acristoffers/tree-sitter-matlab/issues"},"dist":{"shasum":"a8d7be3a3aa0f982444ab2f771e1f8ed9de730c1","tarball":"https://registry.npmjs.org/@acristoffers/tree-sitter-matlab/-/tree-sitter-matlab-1.2.13.tgz","fileCount":34,"integrity":"sha512-9+R59xVXL5hAKEtxK1bqHPM2o/iOL1b7qT2RwJZ2vAQ09BBBIBOAFVEFSAVq/r+0hmbQGQqRUtUDCGcB85T6OA==","signatures":[{"sig":"MEQCIF6Y3d7bRBq19XVqLL+36hccvW0smNiCfE8uz4hWVwT8AiBKy7DVqrbk93zF0JvUgLEuTvKTltJLp6JpTaSgBY51HQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@acristoffers%2ftree-sitter-matlab@1.2.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":3788161},"main":"bindings/node","type":"commonjs","types":"bindings/node","gitHead":"897b66e70ab3c2f6e6f4e3e0ac13c736650bbbfc","scripts":{"test":"node --test bindings/node/*_test.js","start":"tree-sitter playground","install":"node-gyp-build","prestart":"tree-sitter build --wasm"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8d1b4848-07f1-4d4f-a682-966e128b1af1"}},"repository":{"url":"git+https://github.com/acristoffers/tree-sitter-matlab.git","type":"git"},"_npmVersion":"11.8.0","description":"MATLAB tree-sitter parser","directories":{"test":"test"},"_nodeVersion":"20.20.0","dependencies":{"node-addon-api":"^8.2.1","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.25.3"},"peerDependencies":{"tree-sitter":"^0.21.1"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tree-sitter-matlab_1.2.13_1769961230055_0.3869525261763531","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@acristoffers/tree-sitter-matlab","version":"1.3.0","description":"MATLAB tree-sitter parser","keywords":["incremental","parsing","tree-sitter","matlab"],"homepage":"https://github.com/acristoffers/tree-sitter-matlab#readme","bugs":{"url":"https://github.com/acristoffers/tree-sitter-matlab/issues"},"repository":{"type":"git","url":"git+https://github.com/acristoffers/tree-sitter-matlab.git"},"license":"MIT","author":{"name":"Álan Crístoffer e Sousa"},"type":"commonjs","main":"bindings/node","types":"bindings/node","directories":{"test":"test"},"scripts":{"install":"node-gyp-build","prestart":"tree-sitter build --wasm","start":"tree-sitter playground","test":"node --test bindings/node/*_test.js"},"dependencies":{"node-addon-api":"^8.2.1","node-gyp-build":"^4.8.2"},"devDependencies":{"prebuildify":"^6.0.1","tree-sitter-cli":"^0.25.3"},"peerDependencies":{"tree-sitter":"^0.21.1"},"peerDependenciesMeta":{"tree-sitter":{"optional":true}},"gitHead":"c892c8530e70e4a96e0b130c820e8989925fb9a1","_id":"@acristoffers/tree-sitter-matlab@1.3.0","_nodeVersion":"20.20.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-xYnt/8g55kAcrj96kFBQ3oPeDnwOoJ/hb3zDOlxSQJcfyZ+BljlvNha2ddn1zfjjpzAK2EmCZBunM4NQ+5TRfA==","shasum":"6a0ad86455e4d09e9df0f778bd8f4471e56408ce","tarball":"https://registry.npmjs.org/@acristoffers/tree-sitter-matlab/-/tree-sitter-matlab-1.3.0.tgz","fileCount":34,"unpackedSize":3542967,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@acristoffers%2ftree-sitter-matlab@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDv7SIeInGKnS+fdbBuVQ1txBX+5bLyA5obSP+ZbOaBQwIhAOUJ8+RtfofY1TwBHljG3456TivGWO6eAGPXTCI1jG4L"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8d1b4848-07f1-4d4f-a682-966e128b1af1"}},"maintainers":[{"name":"acristoffers","email":"acristoffers@startmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tree-sitter-matlab_1.3.0_1770190863609_0.16578084927199854"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-01T17:14:13.806Z","modified":"2026-02-04T07:41:04.120Z","1.2.4":"2025-11-01T17:14:14.175Z","1.2.12":"2026-01-31T12:29:13.140Z","1.2.13":"2026-02-01T15:53:50.313Z","1.3.0":"2026-02-04T07:41:03.790Z"},"bugs":{"url":"https://github.com/acristoffers/tree-sitter-matlab/issues"},"author":{"name":"Álan Crístoffer e Sousa"},"license":"MIT","homepage":"https://github.com/acristoffers/tree-sitter-matlab#readme","keywords":["incremental","parsing","tree-sitter","matlab"],"repository":{"type":"git","url":"git+https://github.com/acristoffers/tree-sitter-matlab.git"},"description":"MATLAB tree-sitter parser","maintainers":[{"name":"acristoffers","email":"acristoffers@startmail.com"}],"readme":"# MATLAB grammar for tree-sitter.\n\nThere are screenshots at the end of this README :)\n\nThis parser has the objective of generating a tree that is as correct as\npossible (but sometimes just convenient) with what MATLAB itself executes. It\nis not intended only for syntax highlight, but also to be used by scripts to\nwhatever it may be needed. In fact, I wrote it because I'm a Neovim/Doom Emacs\nuser and love having text-objects, and was really missing a text object for\nmatrices rows/cells.\n\nBeing as correct as possible means that some things are done correctly, for\nexample:\n\n- Commands are parsed the same way MATLAB does it, by treating arguments as\nliterals, grouping them correctly and only starting comments when allowed. It\nshould perfectly match what MATLAB does.\n\n- Assignment has its own token, and multiple-variable assignment is NOT an\nassignment to a matrix (and returning an error is the correct thing to do, as\nit allows the user to see that something is off with the highlight, meaning\nsomething is probably off with the code):\n\n```matlab\n% (assignment (multioutput_variable (identifier) (identifier)) (identifier))\n[a,b] = d\n\n% this is WRONG:\n[a;b] = d\n```\n\n- Inside a matrix, `1 + 1` and `1 +1` are different things:\n\n```matlab\na = 1 + 1 % 2\na = 1 +1 %2\n[1 + 1] == [2]\n[1 +1]  == [1 1]\n```\n\nBeing convenient means that sometimes the difference between what is acceptable\nand what is not acceptable lives in the semantics, so we can't know. In such\ncases I just accept semantically wrong but syntax correct things and group them\nin the same token (first example). I do the same when the overhead of\ngenerating a specific token would not really pay off (second example).\n\n- Function calls and Matrix Indexing are the same in MATLAB: `A(1)` can be any\nof them and you cannot tell them apart unless you know for sure what `A` is\nreferring to. So for convenience I just generate a `function_call` for them and\nalso for cell indexing `A{1}`. The \"problem\" with that is that this is a valid\nindexing but an invalid function call: `A(:)`. However I don't distinguish at\nall and say that all of them are `function_call`.\n\n- Function definitions, when inside a class, accepts a special syntax for the\nname of the function, allowing it to be preceded by either `get.` or `set.`,\nlike `function get.name()`. I could have a `method_definition` that would allow\nthat to only be valid in the class context, but I doubt that would be worth it.\nSo any function anywhere can have those and be recognize as correct still.\nGiven the existence of external method definition, maybe that is even the\ncorrect thing to do, since we don't know if the current file is inside a\nspecial class folder.\n\n# Installation\n\nThis parser is available in the following editors:\n\n| Editor | Plugin              | Highlights | Folds | Indents | Code Format | Injections  | Locals |\n| :---   | :---                | :---       | :---  | :---    | :---        | :---        | :---   |\n| Emacs  | [Emacs-MATLAB-Mode] | ✔          | ✘     | ✔       | ✔           | ✔           | ✘      |\n| Helix  | Builtin             | ✔          | ✘     | ✔       | ✘           | ✘           | ✘      |\n| NeoVim | [nvim-treesitter]   | ✔          | ✔     | ✔       | ✘           | ✔           | ✔      |\n\nThe columns have the following meaning:\n\n- *Highlights*: supports syntax highlight\n- *Folds*: supports code folding\n- *Indents*: supports code indenting, which adjusts the leftmost whitespace on each line.\n- *Code Format*: indent includes code formatting that standardizes the spacing of language elements\n  within code lines, aligns matrix columns, adds missing commas within cells and matrices, etc.\n- *Injections*: supports embedding the language into another language (i.e.: MATLAB code blocks inside\n  Markdown or [org-mode](https://orgmode.org/))\n- *Locals*: supports identifying variables/functions/etc scope\n\n# Known issues\n\n- There is a conflict between numbers and element-wise operators that will\n  cause a wrong parse if there is no space between the number and the operator.\n  For example, `1./a` will be interpreted as `1. / a` instead of the correct\n  `1 ./ a`. This problem does not happen if there is a space between the number\n  and the operator.\n\n# Screenshots\n\n![First Screenshot](https://raw.githubusercontent.com/acristoffers/tree-sitter-matlab/screenshots/s1.png)\n![Second Screenshot](https://raw.githubusercontent.com/acristoffers/tree-sitter-matlab/screenshots/s2.png)\n![Third Screenshot](https://raw.githubusercontent.com/acristoffers/tree-sitter-matlab/screenshots/s3.png)\n\n[Emacs-MATLAB-Mode]: https://github.com/mathworks/Emacs-MATLAB-Mode\n[nvim-treesitter]: https://github.com/nvim-treesitter/nvim-treesitter\n","readmeFilename":"README.md"}