feat(lang): add Meson language support (#2314)
https://mesonbuild.com/Syntax.html
commit2cb1ea7127122bbcb0f05dfbb7959334c751c3d7
authorunrelentingtech <greg@unrelenting.technology>
dateWed 11 May 2022, 04:06 (4 years ago)
parent807cdc6
book/src/generated/lang-support.md+1
@@ -53,6 +53,7 @@
5353| lua | ✓ | | ✓ | |
5454| make | ✓ | | | |
5555| markdown | ✓ | | | |
56+| meson | ✓ | | ✓ | |
5657| mint | | | | `mint` |
5758| nickel | ✓ | | ✓ | `nls` |
5859| nix | ✓ | | ✓ | `rnix-lsp` |
languages.toml+13
@@ -1342,3 +1342,16 @@ indent = { tab-width = 4, unit = " " }
13421342[[grammar]]
13431343name = "odin"
13441344source = { git = "https://github.com/MineBill/tree-sitter-odin", rev = "da885f4a387f169b9b69fe0968259ee257a8f69a" }
1345+
1346+[[language]]
1347+name = "meson"
1348+scope = "source.meson"
1349+injection-regex = "meson"
1350+file-types = ["meson.build"]
1351+roots = []
1352+comment-token = "#"
1353+indent = { tab-width = 2, unit = " " }
1354+
1355+[[grammar]]
1356+name = "meson"
1357+source = { git = "https://github.com/bearcove/tree-sitter-meson", rev = "feea83be9225842490066522ced2d13eb9cce0bd" }
runtime/queries/meson/highlights.scmnew file+62
@@ -0,0 +1,62 @@
1+(string_literal) @string
2+
3+(boolean_literal) @constant.builtin.boolean
4+(integer_literal) @constant.numeric.integer
5+
6+(comment) @comment.line
7+(function_id) @function
8+(keyword_arg_key) @variable.other.member
9+(id_expression) @variable
10+
11+[
12+ "if"
13+ "elif"
14+ "else"
15+ "endif"
16+] @keyword.control.conditional
17+
18+[
19+ "foreach"
20+ "endforeach"
21+] @keyword.control.repeat
22+
23+[
24+ "break"
25+ "continue"
26+] @keyword.control
27+
28+[
29+ "not"
30+ "in"
31+ "and"
32+ "or"
33+] @keyword.operator
34+
35+[
36+ "!"
37+ "+"
38+ "-"
39+ "*"
40+ "/"
41+ "%"
42+ "=="
43+ "!="
44+ ">"
45+ "<"
46+ ">="
47+ "<="
48+] @operator
49+
50+[
51+ ":"
52+ ","
53+] @punctuation.delimiter
54+
55+[
56+ "("
57+ ")"
58+ "["
59+ "]"
60+ "{"
61+ "}"
62+] @punctuation.bracket
runtime/queries/meson/indents.scmnew file+16
@@ -0,0 +1,16 @@
1+[
2+ (method_expression)
3+ (function_expression)
4+ (array_literal)
5+ (dictionary_literal)
6+ (selection_statement)
7+ (iteration_statement)
8+] @indent
9+
10+[
11+ ")"
12+ "]"
13+ "}"
14+ "endif"
15+ "endforeach"
16+] @outdent