From d05728e155ced9a815bb3f6fc9e8004093beb3d3 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Mon, 20 Apr 2020 16:18:02 +0200 Subject: feat: syntax highlighting --- queries/lua/highlights.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 queries/lua/highlights.scm (limited to 'queries/lua') diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm new file mode 100644 index 00000000..6efdece7 --- /dev/null +++ b/queries/lua/highlights.scm @@ -0,0 +1,36 @@ +;;; Highlighting for lua + +;;; Builtins +;; Keywords +"local" @keyword +"if" @keyword +"then" @keyword +"else" @keyword +"elseif" @keyword +"end" @keyword +"return" @keyword +"do" @keyword +"while" @keyword +"repeat" @keyword +"for" @keyword + +;; Operators +"~=" @operator +"==" @operator +"not" @operator +"and" @operator +"or" @operator + +;; Constants +(false) @constant +(true) @constant +(nil) @constant + +;; Nodes +(function "function" @function "end" @function) +(comment) @comment +(string) @string +(number) @constant + +;; Error +(ERROR) @Error -- cgit v1.2.3 From c4862c656ec4a8edc8c33974779920c104dfee4a Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Mon, 20 Apr 2020 19:13:24 +0200 Subject: highlight(lua): add more operators --- queries/lua/highlights.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'queries/lua') diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 6efdece7..4ce331fa 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -13,24 +13,48 @@ "while" @keyword "repeat" @keyword "for" @keyword +(break_statement) @keyword +"goto" @keyword ;; Operators "~=" @operator "==" @operator +"<=" @operator +">=" @operator "not" @operator "and" @operator "or" @operator +"<" @operator +">" @operator + +"+" @operator +"-" @operator +"%" @operator +"/" @operator +"//" @operator +"*" @operator +"^" @operator +"&" @operator +"~" @operator +"|" @operator +">>" @operator +"<<" @operator +".." @operator +"#" @operator ;; Constants (false) @constant (true) @constant (nil) @constant +(spread) @constant ;; "..." ;; Nodes (function "function" @function "end" @function) +(table "{" @operator "}" @operator) (comment) @comment (string) @string -(number) @constant +(number) @number +(label_statement) @label ;; Error (ERROR) @Error -- cgit v1.2.3