Skip to content

Commit a840787

Browse files
committed
Added Literate Haskell tree-sitter grammar and queries
1 parent b40d168 commit a840787

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

languages.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,10 @@ block-comment-tokens = { start = "{-", end = "-}" }
16031603
language-servers = [ "haskell-language-server" ]
16041604
indent = { tab-width = 2, unit = " " }
16051605

1606+
[[grammar]]
1607+
name = "haskell-literate"
1608+
source = { git = "https://github.com/LaurentRDC/tree-sitter-haskell-literate", rev = "8ad7bd1b1595f4cc1a4ccc775d4a3c460f43a596" }
1609+
16061610
[[language]]
16071611
name = "purescript"
16081612
scope = "source.purescript"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; Bird track marker
2+
(bird_line ">" @punctuation.special)
3+
4+
; LaTeX delimiters
5+
(latex_begin) @keyword.directive
6+
(latex_end) @keyword.directive
7+
8+
; Highlight LaTeX comments like comments
9+
(latex_comment) @comment
10+
11+
; Markdown delimiters
12+
(markdown_begin) @keyword.directive
13+
(markdown_end) @keyword.directive
14+
15+
; Normal prose is not highlighted. Haskell code will be
16+
; highlighted by the injected Haskell grammar
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; Inject Haskell parser into bird-style code lines
2+
((bird_line
3+
(haskell_code) @injection.content)
4+
(#set! injection.language "haskell"))
5+
6+
; Inject Haskell parser into LaTeX code blocks
7+
((latex_code_line
8+
(haskell_code) @injection.content)
9+
(#set! injection.language "haskell"))
10+
11+
; Inject Haskell parser into Markdown code blocks
12+
((markdown_code_line
13+
(haskell_code) @injection.content)
14+
(#set! injection.language "haskell"))

0 commit comments

Comments
 (0)