Skip to content

Commit

Permalink
ML_LANG versions
Browse files Browse the repository at this point in the history
  • Loading branch information
apozharski committed Sep 5, 2024
1 parent 6fde0b2 commit 263240f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Sphinx>=4.0.0",
"Pygments>=2.0.1",
"tree-sitter-matlab>=1.0.1",
"tree-sitter>=0.22.0",
"tree-sitter>=0.21.3",
]

setup(
Expand Down
6 changes: 5 additions & 1 deletion sphinxcontrib/mat_tree_sitter_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
)
# rpath = "/home/anton/tools/matlabdomain/tests/test_data/submodule/f_empty_output.m"

ML_LANG = Language(tsml.language(), "matlab")
tree_sitter_ver = tuple([int(sec) for sec in version("tree_sitter").split(".")])
if tree_sitter_ver[1] == 21:
ML_LANG = Language(tsml.language(), "matlab")
else:
ML_LANG = Language(tsml.language())

# QUERIES
q_classdef = ML_LANG.query(
Expand Down

0 comments on commit 263240f

Please sign in to comment.