From c38646edf2bdfac157ca619697ecad9ea87fd469 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 23 Feb 2023 18:44:10 -0500 Subject: feat: add cpon --- queries/cpon/folds.scm | 5 +++++ queries/cpon/highlights.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++ queries/cpon/indents.scm | 23 +++++++++++++++++++++++ queries/cpon/injections.scm | 1 + queries/cpon/locals.scm | 7 +++++++ 5 files changed, 81 insertions(+) create mode 100644 queries/cpon/folds.scm create mode 100644 queries/cpon/highlights.scm create mode 100644 queries/cpon/indents.scm create mode 100644 queries/cpon/injections.scm create mode 100644 queries/cpon/locals.scm (limited to 'queries/cpon') diff --git a/queries/cpon/folds.scm b/queries/cpon/folds.scm new file mode 100644 index 000000000..02feec4e1 --- /dev/null +++ b/queries/cpon/folds.scm @@ -0,0 +1,5 @@ +[ + (meta_map) + (map) + (array) +] @fold diff --git a/queries/cpon/highlights.scm b/queries/cpon/highlights.scm new file mode 100644 index 000000000..f08647293 --- /dev/null +++ b/queries/cpon/highlights.scm @@ -0,0 +1,45 @@ +; Literals + +(string) @string +(escape_sequence) @string.escape + +(hex_blob + "x" @character.special + (_) @string) + +(esc_blob + "b" @character.special + (_) @string) + +(datetime + "d" @character.special + (_) @string.special) + +(number) @number + +(float) @float + +(boolean) @boolean + +(null) @constant.builtin + +; Punctuation + +[ + "," + ":" +] @punctuation.delimiter + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +; Comments + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/queries/cpon/indents.scm b/queries/cpon/indents.scm new file mode 100644 index 000000000..477ea83b5 --- /dev/null +++ b/queries/cpon/indents.scm @@ -0,0 +1,23 @@ +[ + (meta_map) + (map) + (imap) + (array) +] @indent + +[ + "]" + "}" + ">" +] @indent_end + +[ "{" "}" ] @branch + +[ "[" "]" ] @branch + +[ "<" ">" ] @branch + +[ + (ERROR) + (comment) +] @auto diff --git a/queries/cpon/injections.scm b/queries/cpon/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/queries/cpon/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/queries/cpon/locals.scm b/queries/cpon/locals.scm new file mode 100644 index 000000000..c1854af91 --- /dev/null +++ b/queries/cpon/locals.scm @@ -0,0 +1,7 @@ +[ + (document) + + (meta_map) + (map) + (array) +] @scope -- cgit v1.2.3-70-g09d2