From 8f2af713408b8b40cf71873bbc0ddc009a7b3da5 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Mon, 3 Jan 2022 02:57:55 +0100 Subject: Add LLVM TableGen highlighting (#1409) Add a tree-sitter grammar and highlights for TableGen files. TableGen and its grammar are described here: https://llvm.org/docs/TableGen/index.html Co-authored-by: Blaž Hrastnik --- runtime/queries/tablegen/highlights.scm | 90 +++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 runtime/queries/tablegen/highlights.scm (limited to 'runtime/queries/tablegen/highlights.scm') diff --git a/runtime/queries/tablegen/highlights.scm b/runtime/queries/tablegen/highlights.scm new file mode 100644 index 00000000..8ade5ba9 --- /dev/null +++ b/runtime/queries/tablegen/highlights.scm @@ -0,0 +1,90 @@ +[ + (comment) + (multiline_comment) +] @comment + +[ + "(" + ")" + "[" + "]" + "{" + "}" + "<" + ">" +] @punctuation.bracket + +[ + "," + ";" + "." +] @punctuation.delimiter + +[ + "#" + "-" + "..." + ":" +] @operator + +[ + "=" + "!cond" + (operator_keyword) +] @function + +[ + "true" + "false" +] @constant.builtin.boolean + +[ + "?" +] @constant.builtin + +(var) @variable + +(template_arg (identifier) @variable.parameter) + +(_ argument: (value (identifier) @variable.parameter)) + +(type) @type + +"code" @type.builtin + +(number) @constant.numeric.integer +[ + (string_string) + (code_string) +] @string + +(preprocessor) @keyword.directive + +[ + "class" + "field" + "let" + "defvar" + "def" + "defset" + "defvar" + "assert" +] @keyword + +[ + "let" + "in" + "foreach" + "if" + "then" + "else" +] @keyword.operator + +"include" @keyword.control.import + +[ + "multiclass" + "defm" +] @namespace + +(ERROR) @error -- cgit v1.2.3-70-g09d2