diff --git a/queries/highlights.scm b/queries/highlights.scm index cf22b13..649aa1f 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -1,5 +1,28 @@ (comment) @comment +; Keywords {{{ +[ + "array" + (break_expression) + "do" + "else" + "end" + "for" + "function" + "if" + "import" + "in" + "let" + "of" + "primitive" + "then" + "to" + "type" + "var" + "while" +] @keyword +; }}} + ; Literals {{{ (nil_literal) @constant.builtin (integer_literal) @number diff --git a/test/highlight/keywords.tig b/test/highlight/keywords.tig new file mode 100644 index 0000000..122d91a --- /dev/null +++ b/test/highlight/keywords.tig @@ -0,0 +1,41 @@ +let +/* <- keyword */ + + var a := 12 + /* <- keyword */ + + function f() : int = a + /* <- keyword */ + primitive g() + /* <- keyword */ + + import "lib.tih" + /* <- keyword */ + + type array_of_int = array of int + /* <- keyword */ + /* ^ keyword */ + /* ^ keyword */ + +in +/* <- keyword */ + + 12; + + if 12 then 27 else 42; + /* <- keyword */ + /* ^ keyword */ + /* ^ keyword */ + + for i := 12 to 27 do 42; + /* <- keyword */ + /* ^ keyword */ + /* ^ keyword */ + + while 12 do break + /* <- keyword */ + /* ^ keyword */ + /* ^ keyword */ + +end +/* <- keyword */