diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm index 52fd4fbbd..a0eecf977 100644 --- a/queries/haskell/highlights.scm +++ b/queries/haskell/highlights.scm @@ -122,3 +122,10 @@ ; True or False ((constructor) @_bool (#match? @_bool "(True|False)")) @boolean + + +;; ---------------------------------------------------------------------------- +;; Quasi-quotes + +(quoter) @function +; Highlighting of quasiquote_body is handled by injections.scm diff --git a/queries/haskell/injections.scm b/queries/haskell/injections.scm new file mode 100644 index 000000000..b72770907 --- /dev/null +++ b/queries/haskell/injections.scm @@ -0,0 +1,57 @@ +;; ----------------------------------------------------------------------------- +;; General language injection + +(quasiquote + ((quoter) @language) + ((quasiquote_body) @content) +) + + +;; ----------------------------------------------------------------------------- +;; shakespeare library +;; NOTE: doesn't support templating + +; TODO: add once CoffeeScript parser is added +; ; CoffeeScript: Text.Coffee +; (quasiquote +; (quoter) @_name +; (#eq? @_name "coffee") +; ((quasiquote_body) @coffeescript) + +; CSS: Text.Cassius, Text.Lucius +(quasiquote + (quoter) @_name + (#any-of? @_name "cassius" "lucius") + ((quasiquote_body) @css) +) + +; HTML: Text.Hamlet +(quasiquote + (quoter) @_name + (#any-of? @_name "shamlet" "xshamlet" "hamlet" "xhamlet" "ihamlet") + ((quasiquote_body) @html) +) + +; JS: Text.Julius +(quasiquote + (quoter) @_name + (#any-of? @_name "js" "julius") + ((quasiquote_body) @javascript) +) + +; TS: Text.TypeScript +(quasiquote + (quoter) @_name + (#any-of? @_name "tsc" "tscJSX") + ((quasiquote_body) @typescript) +) + + +;; ----------------------------------------------------------------------------- +;; HSX + +(quasiquote + (quoter) @_name + (#eq? @_name "hsx") + ((quasiquote_body) @html) +)