From 9275a15aadc6a429af23fd82245fea5ed2799e71 Mon Sep 17 00:00:00 2001 From: mhoffm Date: Mon, 28 Jun 2021 19:11:33 +0200 Subject: add hcl parser --- queries/hcl/folds.scm | 5 ++++ queries/hcl/highlights.scm | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 queries/hcl/folds.scm create mode 100644 queries/hcl/highlights.scm (limited to 'queries') diff --git a/queries/hcl/folds.scm b/queries/hcl/folds.scm new file mode 100644 index 000000000..8349f4f91 --- /dev/null +++ b/queries/hcl/folds.scm @@ -0,0 +1,5 @@ +[ + (comment) + (block) + (heredoc_template) +] @fold diff --git a/queries/hcl/highlights.scm b/queries/hcl/highlights.scm new file mode 100644 index 000000000..135351ac3 --- /dev/null +++ b/queries/hcl/highlights.scm @@ -0,0 +1,72 @@ +; highlights.scm + +[ + "!" + "\*" + "/" + "%" + "\+" + "-" + ">" + ">=" + "<" + "<=" + "==" + "!=" + "&&" + "||" +] @operator + +[ + "{" + "}" + "[" + "]" + "(" + ")" + "[*]" + ".*" +] @specialChar + +[ + "." + "," +] @specialChar + +[ + (ellipsis) + "\?" + ":" + "=>" +] @special + +[ + "for" + "in" +] @repeat + +[ + "if" +] @conditional + +[ + (string_lit) + (quoted_template) + (heredoc_template) +] @string + +(heredoc_identifier) @namespace +(heredoc_start) @namespace +(template_interpolation) @statement +(numeric_lit) @number +(bool_lit) @boolean +(null_lit) @constant +(comment) @comment +(identifier) @identifier + +(block (identifier) @namespace) +(function_call (identifier) @function) +(function_call (function_arguments) @parameter) +(attribute (identifier) @symbol) + +(ERROR) @error -- cgit v1.2.3-70-g09d2