summaryrefslogtreecommitdiffstats
path: root/mlir/utils/vim
diff options
context:
space:
mode:
authorUday Bondhugula <bondhugula@google.com>2018-07-29 20:28:25 -0700
committerjpienaar <jpienaar@google.com>2019-03-29 12:48:05 -0700
commite990ec65d03c7f5652ce0c697bd7baf26a34fcbc (patch)
tree6100d472cb4057fd9a135b533977ad4c44825b6a /mlir/utils/vim
parentc7d660ec392b4b2f719786cabd8f878e1f1aeb44 (diff)
downloadbcm5719-llvm-e990ec65d03c7f5652ce0c697bd7baf26a34fcbc.tar.gz
bcm5719-llvm-e990ec65d03c7f5652ce0c697bd7baf26a34fcbc.zip
Internal change
PiperOrigin-RevId: 206522239
Diffstat (limited to 'mlir/utils/vim')
-rw-r--r--mlir/utils/vim/mlir.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/mlir/utils/vim/mlir.vim b/mlir/utils/vim/mlir.vim
new file mode 100644
index 00000000000..b2d70e7ca9e
--- /dev/null
+++ b/mlir/utils/vim/mlir.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language: MLIR
+
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syn keyword mlirType affineint i1 i2 i4 i8 i13 i16 i32 i64
+ \ f16 f32
+syn keyword mlirType memref tensor vector
+
+syntax keyword mlirKeywords extfunc cfgfunc mlfunc for to step return
+syntax keyword mlirConditional if else
+
+syn match mlirInt "-\=\<\d\+\>"
+syn match mlirFloat "-\=\<\d\+\.\d\+\>"
+syn match mlirMapOutline "#.*$"
+syn match mlirOperator "[+\-*=]"
+
+syn region mlirComment start="//" skip="\\$" end="$"
+syn region mlirString matchgroup=mlirString start=+"+ end=+"+
+
+hi def link mlirComment Comment
+hi def link mlirKeywords Statement
+hi def link mlirInt Constant
+hi def link mlirType Type
+hi def link mlirMapOutline PreProc
+hi def link mlirConditional Conditional
+hi def link mlirString String
+hi def link mlirOperator Operator
+hi def link mlirInstruction Operator
+hi def link mlirAffineOp Operator
+
+let b:current_syntax = "mlir"
OpenPOWER on IntegriCloud