Skip to content

A tree-sitter grammar for Bluespec Classic#1026

Open
mieszko wants to merge 1 commit into
B-Lang-org:mainfrom
mieszko:tree-sitter-grammar
Open

A tree-sitter grammar for Bluespec Classic#1026
mieszko wants to merge 1 commit into
B-Lang-org:mainfrom
mieszko:tree-sitter-grammar

Conversation

@mieszko

@mieszko mieszko commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

A tree-sitter grammar for Bluespec Classic, suitable for use as syntax highlighting.

@mieszko
mieszko requested a review from nanavati July 7, 2026 16:57
@quark17

quark17 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

We set up the repo B-Lang-org/language-bh to hold a grammar for BH, and registered that URL with GitHub's Linguist repo (so that GitHub highlighting uses it). The language-bh repo is also published as a VSCode plugin, that people can install from the VS Marketplace, to do highlighting. (Although it might need updating to newer dependency versions.)

That grammar is just a Haskell Textmate grammar that's been adapted, with the idea that people could contribute to improving it. If you've got something better, we could replace it with your grammar? (rather than put it here in util)

@mieszko
mieszko requested a review from quark17 July 9, 2026 16:35
@mieszko

mieszko commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

I'm not sure I follow. This is a tree-sitter grammar, not a textmate grammar, though?

@mieszko

mieszko commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Also, I only put it in util b/c there are already highlighter syntaxes there. But yeah ideally it would have its own repo under b-lang-org, otherwise the whole repo gets pulled in just to extract and compile the grammar. I can do that instead if you like?

@matx-amy

Copy link
Copy Markdown
Contributor

I think it'd be better to put it in its own repo if the plan is to commit the very large generated files.

I'd also be happier if this had some tests to ensure it correctly parses everything in the repo; I'm doing that like this (flake.nix#L47, misc/tree-sitter-check-parse/main.c) in a different compiler.

(I'm not committing generated files there, but that's because I'm pinning the version of tree-sitter; tree-sitter has breaking changes often enough that it's probably a good idea to do one of the two if this is "first-class" instead of "best-effort.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants