tree-sitter-systemverilog fix attempt#7279
Conversation
a4e67c3 to
8e7646d
Compare
|
With the changes in this PR, tree-sitter-systemverilog seems to be working as expected. However tree-sitter-verilog tries to execute tree-sitter-verilog as well (and fails) - @gmlarumbe shouldn't tree-sitter-verilog be converted to something similar as your systemverilog work? (i.e. tree-sitter parse, but with a different language selected - is that doable?) |
|
Hi @tgorochowik , Thanks for taking the time to fix the integration of Regarding Feel free to change it to see if it works. On the other hand, the Hope this helps. |
import os
import shutil
from BaseRunner import BaseRunner
class tree_sitter_verilog(BaseRunner):
def __init__(self):
super().__init__(
"tree-sitter-verilog", "tree-sitter", {"parsing"})
self.submodule = "third_party/tools/tree-sitter-verilog"
self.url = f"https://github.com/tree-sitter/tree-sitter-verilog/tree/{self.get_commit()}"
def prepare_run_cb(self, tmp_dir, params):
self.cmd = [
self.executable, 'parse', '--scope', 'source.verilog'
]
self.cmd += params['files']Replacing current |
|
@tgorochowik @gmlarumbe |
|
Hi @drom, AFAIK The issues/PRs that modify On the other hand I would be more than happy if you decided to take over the update of your grammar here. I was doing it so far since it seemed unmaintained, with many issues and PRs opened and with no answer for more than 2 years. |
|
This probably has something to do with it:
But probably @tgorochowik can tell you better. |
|
@drom It was a bug. It's been fixed. |
`tree-sitter parse` expects the grammar.json in `$CWD/src/grammar.json`. The previous `runners.mk` copied the generated `src/` directory, with the grammar, to `out/tmp`, which resulted in failing tests, as runners execute in a random out/tmp/tmp_dir. * Move generated `src/` directory under `out/tmp/tree-sitter-systemverilog/parser` and set shell env variable indicating this directory. * Symlink the parser directory to tmp_dir/src in `tree_sitter_systemverilog.py` runner, so `tree-sitter parse` can find the grammar. Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Simplify `tree_sitter_verilog.py runner, to leverage the `tree-sitter` executable instead of `.so` library, for parsing. Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
8e7646d to
5e168b6
Compare
Changes In Tests
|

Ref #7264
This PR should fix the installation and invocation of tree sitter systemverilog