From 5504b84d215e1f6a77ca27e68200840e2a3645f8 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Sat, 5 Sep 2020 09:53:21 -0500 Subject: [PATCH] Lua: fix loop and conditional keywords highlights --- queries/lua/highlights.scm | 48 ++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 0ea6f6355..9f7661a45 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -2,27 +2,45 @@ ;;; Builtins ;; Keywords -( - "if" @conditional - "end" @conditional -) + +(if_statement +[ + "if" + "then" + "end" +] @conditional) + [ "else" "elseif" - "then" -] @conditional +] @contional - -( - [ - "do" - "while" - "repeat" +(for_statement +[ "for" - ] @repeat + "do" + "end" +] @repeat) - "end" @repeat -) +(for_in_statement +[ + "for" + "do" + "end" +] @repeat) + +(while_statement +[ + "while" + "do" + "end" +] @repeat) + +(repeat_statement +[ + "repeat" + "until" +] @repeat) [ "in"