Commit Graph

5 Commits

Author SHA1 Message Date
River Riddle
86f5caeee9 [mlir] Significantly overhaul the textmate grammar
The current grammar is really crusty, only supports a handful of
cases, and is also out-of-date after various refactorings. This commit
refactors the textmate grammar to handle significantly more cases,
and now provides proper coloring for a majority of cases (including
dialect attributes, operations, types, etc.)

Differential Revision: https://reviews.llvm.org/D125458
2022-05-12 15:50:32 -07:00
Jacques Pienaar
d5db25fb1d [mlir][textmate] Add support for function visibility
Avoids functions with visibility not being marked as functions. Tested
via Lightshow.
2022-01-18 18:48:43 -08:00
Jacques Pienaar
b9fa45864d Use simpler highlighting textmate syntax
Changes from:
https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code=

To:
https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fsimpler%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code=

Which I think is an improvement.

PiperOrigin-RevId: 280674770
2019-11-15 09:29:40 -08:00
Jacques Pienaar
a6fac0aa29 Update textmate syntax file
Allow comments in more places and fix function params.

PiperOrigin-RevId: 279986797
2019-11-12 09:30:41 -08:00
Jacques Pienaar
532c652d6c Add start of textmate language grammar.
Basic* grammar to start of with, this doesn't handle custom ops and doesn't
handle ops with regions. But useful enough to make reading the .mlir files
easier.

Followed the approach used for emacs & vim and placed in separate directory
under utils.

* I got a little bit carried away trying to handle attributes and tried to do some custom op printing handling, but finally abandoned it. Also first time writing a textmate grammar so I assume a lot can be improved :)

PiperOrigin-RevId: 262985490
2019-08-12 12:53:21 -07:00