From 7c338429f845315fb276ff482f91b94b3102dbd8 Mon Sep 17 00:00:00 2001 From: Borys Lykah Date: Sun, 9 Jul 2023 11:17:01 -0600 Subject: Add language support for persistent library syntax (#7261) --- runtime/queries/haskell-persistent/folds.scm | 3 ++ runtime/queries/haskell-persistent/highlights.scm | 37 +++++++++++++++++++++++ runtime/queries/haskell-persistent/locals.scm | 1 + 3 files changed, 41 insertions(+) create mode 100644 runtime/queries/haskell-persistent/folds.scm create mode 100644 runtime/queries/haskell-persistent/highlights.scm create mode 100644 runtime/queries/haskell-persistent/locals.scm (limited to 'runtime/queries/haskell-persistent') diff --git a/runtime/queries/haskell-persistent/folds.scm b/runtime/queries/haskell-persistent/folds.scm new file mode 100644 index 00000000..ac04ad4a --- /dev/null +++ b/runtime/queries/haskell-persistent/folds.scm @@ -0,0 +1,3 @@ +[ + (entity_definition) +] @fold diff --git a/runtime/queries/haskell-persistent/highlights.scm b/runtime/queries/haskell-persistent/highlights.scm new file mode 100644 index 00000000..d6358578 --- /dev/null +++ b/runtime/queries/haskell-persistent/highlights.scm @@ -0,0 +1,37 @@ +;; ---------------------------------------------------------------------------- +;; Literals and comments + +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(char) @constant.character +(string) @string +(attribute_name) @attribute +(attribute_exclamation_mark) @attribute + +(con_unit) @constant.builtin ; unit, as in () + +(comment) @comment + +;; ---------------------------------------------------------------------------- +;; Keywords, operators, includes + +[ + "Id" + "Primary" + "Foreign" + "deriving" +] @keyword + +"=" @operator + +;; ---------------------------------------------------------------------------- +;; Functions and variables + +(variable) @variable + +;; ---------------------------------------------------------------------------- +;; Types + +(type) @type + +(constructor) @constructor diff --git a/runtime/queries/haskell-persistent/locals.scm b/runtime/queries/haskell-persistent/locals.scm new file mode 100644 index 00000000..3ffb01a1 --- /dev/null +++ b/runtime/queries/haskell-persistent/locals.scm @@ -0,0 +1 @@ +(fields (variable)) @local.definition -- cgit v1.2.3-70-g09d2