tree-sitter-matlab

Installing the parser

Neovim

Using a simple function from treesitter

local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.matlab = {
  install_info = {
    url = <path_to_repo>,
    files = { "src/parser.c" },
    branch= 'main'
  },
  filetype = "matlab", -- if filetype does not agrees with parser name
}

In our case <path_to_repo> is https://github.com/mstanciu552/tree-sitter-matlab.git

TODO

  • Basic grammar
  • Add support for variable definition
  • Add support for array and matrix definitions
  • Add syntax highlighting
  • Add function call definition
  • Add support for comments
  • Add numbers in identifier definition
  • Check out class definitions in Matlab