on master help sign in
Added yuck language support (for eww) (#6064)
commitb89b2eaf68c53a2c10a0f649f9487ad46c85e11e authorPhilipp Mildenberger <philipp@mildenberger.me> dateMon 20 Feb 2023, 23:42 (4 years ago) parent44729fb
4 files changed+82
book/src/generated/lang-support.md+1 languages.toml+13 runtime/queries/yuck/highlights.scm+66 runtime/queries/yuck/injections.scm+2
book/src/generated/lang-support.md+1
@@ -147,4 +147,5 @@
147147| xit | ✓ | | | |
148148| xml | ✓ | | ✓ | |
149149| yaml | ✓ | | ✓ | `yaml-language-server` |
150+| yuck | ✓ | | | |
150151| zig | ✓ | ✓ | ✓ | `zls` |
languages.toml+13
@@ -2180,3 +2180,16 @@ comment-token = "("
21802180[[grammar]]
21812181name = "uxntal"
21822182source = { git = "https://github.com/Jummit/tree-sitter-uxntal", rev = "9297e95ef74380b0ad84c4fd98f91e9f6e4319e6" }
2183+
2184+[[language]]
2185+name = "yuck"
2186+scope = "source.yuck"
2187+injection-regex = "yuck"
2188+file-types = ["yuck"]
2189+roots = []
2190+comment-token = ";"
2191+indent = { tab-width = 2, unit = " " }
2192+
2193+[[grammar]]
2194+name = "yuck"
2195+source = { git = "https://github.com/Philipp-M/tree-sitter-yuck", rev = "9e97da5773f82123a8c8cccf8f7e795d140ed7d1" }
runtime/queries/yuck/highlights.scmnew file+66
@@ -0,0 +1,66 @@
1+(ERROR) @error
2+
3+(line_comment) @comment
4+
5+; keywords and symbols
6+
7+(keyword) @keyword
8+(symbol) @tag
9+
10+; literals
11+
12+(bool_literal) @constant.builtin.boolean
13+(num_literal) @constant.numeric
14+
15+; strings
16+(string_interpolation
17+ (string_interpolation_start) @punctuation.special
18+ (string_interpolation_end) @punctuation.special)
19+
20+(escape_sequence) @constant.character.escape
21+
22+(string
23+ [
24+ (unescaped_single_quote_string_fragment)
25+ (unescaped_double_quote_string_fragment)
26+ (unescaped_backtick_string_fragment)
27+ "\""
28+ "'"
29+ "`"
30+ ]) @string
31+
32+; operators and general punctuation
33+
34+(unary_expression
35+ operator: _ @operator)
36+
37+(binary_expression
38+ operator: _ @operator)
39+
40+(ternary_expression
41+ operator: _ @operator)
42+
43+[
44+ ":"
45+ "."
46+ ","
47+] @punctuation.delimiter
48+
49+[
50+ "("
51+ ")"
52+ "["
53+ "]"
54+ "{"
55+ "}"
56+] @punctuation.bracket
57+[
58+ ":"
59+ "."
60+ ","
61+] @punctuation.delimiter
62+
63+; Rest (general identifiers that are not yet catched)
64+
65+(index) @variable
66+(ident) @variable
runtime/queries/yuck/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((line_comment) @injection.content
2+ (#set! injection.language "comment"))