Skip to content

Commit cc257e9

Browse files
authored
Add support for webassembly text format (#4040)
1 parent 2113b1b commit cc257e9

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

book/src/generated/lang-support.md

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@
119119
| vala || | | `vala-language-server` |
120120
| verilog ||| | `svlangserver` |
121121
| vue || | | `vls` |
122+
| wast || | | |
123+
| wat || | | |
122124
| wgsl || | | `wgsl_analyzer` |
123125
| xit || | | |
124126
| yaml || || `yaml-language-server` |

languages.toml

+22
Original file line numberDiff line numberDiff line change
@@ -1781,3 +1781,25 @@ language-server = { command = "bass", args = ["--lsp"] }
17811781
[[grammar]]
17821782
name = "bass"
17831783
source = { git = "https://github.com/vito/tree-sitter-bass", rev = "501133e260d768ed4e1fd7374912ed5c86d6fd90" }
1784+
1785+
[[language]]
1786+
name = "wat"
1787+
scope = "source.wat"
1788+
comment-token = ";;"
1789+
file-types = ["wat"]
1790+
roots = []
1791+
1792+
[[grammar]]
1793+
name = "wat"
1794+
source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f9d709847bf7a3de0942a84e912f59088", subpath = "wat" }
1795+
1796+
[[language]]
1797+
name = "wast"
1798+
scope = "source.wast"
1799+
comment-token = ";;"
1800+
file-types = ["wast"]
1801+
roots = []
1802+
1803+
[[grammar]]
1804+
name = "wast"
1805+
source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f9d709847bf7a3de0942a84e912f59088", subpath = "wast" }

runtime/queries/wast/highlights.scm

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; inherits: wat
2+
3+
[
4+
"assert_return"
5+
"assert_trap"
6+
"assert_exhaustion"
7+
"assert_malformed"
8+
"assert_invalid"
9+
"assert_unlinkable"
10+
"assert_trap"
11+
12+
"invoke"
13+
"get"
14+
15+
"script"
16+
"input"
17+
"output"
18+
19+
"binary"
20+
"quote"
21+
] @keyword

runtime/queries/wat/highlights.scm

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
["module" "func" "param" "result" "type" "memory" "elem" "data" "table" "global"] @keyword
2+
3+
["import" "export"] @keyword.control.import
4+
5+
["local"] @keyword.storage.type
6+
7+
[(name) (string)] @string
8+
9+
(identifier) @function
10+
11+
[(comment_block) (comment_line)] @comment
12+
13+
[(nat) (float) (align_offset_value)] @constant.numeric.integer
14+
15+
(value_type) @type
16+
17+
["(" ")"] @punctuation.bracket

0 commit comments

Comments
 (0)