Add common quasiquote highlights/injections for Haskell (#1440)

This commit is contained in:
Farbod Salamat-Zadeh 2021-07-01 01:43:08 +01:00 committed by GitHub
parent cf768b0069
commit efbd01f539
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 0 deletions

View file

@ -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

View file

@ -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)
)