Skip to content

rrbutani/sublime-mlir-syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An MLIR .sublime-syntax grammar

Sources

The textmate reference grammar comes from upstream. This is also the grammar that GitHub (as in, linguist) uses for MLIR code (though it lives outside of llvm/llvm-project it appears to be — as of this writing — identical).

This grammar also draws from the grammar bundled with mlir-vscode; available separately in this repo. As this README notes that grammar has specific support for several MLIR dialects.

Misc

Docs for the sublime-syntax format are here. Names of the scopes are available here.

The real reason this exists is for use with bat which uses syntect (meaning grammars used with it have to be in sublime-syntax form) and supports external language definitions.

Installation

For use with bat

# Download it to the right dir:
mkdir -p "$(bat --config-dir)/syntaxes"
curl -Ls https://raw.githubusercontent.com/rrbutani/sublime-mlir-syntax/main/mlir.sublime-syntax > "$(bat --config-dir)/syntaxes/mlir.sublime-syntax"

# Get `bat` to pick it up:
bat cache --build

# Test it out:
curl -Ls https://raw.githubusercontent.com/rrbutani/sublime-mlir-syntax/main/sample.mlir | bat -lmlir

For use with Sublime Text

(TODO! make a package, link to it here and in the repo's tagline)

Releases

No releases published