on master help sign in
Change Odin grammar to `ap29600/tree-sitter-odin` (#6766)
9cdc6b2ap29600
book/src/generated/lang-support.md+1−1
@@ -98,7 +98,7 @@
98| nu | ✓ | | | |
98| nu | ✓ | | | |
99| ocaml | ✓ | | ✓ | `ocamllsp` |
99| ocaml | ✓ | | ✓ | `ocamllsp` |
100| ocaml-interface | ✓ | | | `ocamllsp` |
100| ocaml-interface | ✓ | | | `ocamllsp` |
101−| odin | ✓ | | | `ols` |
101+| odin | ✓ | | ✓ | `ols` |
102| opencl | ✓ | ✓ | ✓ | `clangd` |
102| opencl | ✓ | ✓ | ✓ | `clangd` |
103| openscad | ✓ | | | `openscad-lsp` |
103| openscad | ✓ | | | `openscad-lsp` |
104| org | ✓ | | | |
104| org | ✓ | | | |
languages.toml+1−1
@@ -1675,7 +1675,7 @@ indent = { tab-width = 4, unit = "\t" }
1675
1675
1676[[grammar]]
1676[[grammar]]
1677name = "odin"
1677name = "odin"
1678−source = { git = "https://github.com/MineBill/tree-sitter-odin", rev = "da885f4a387f169b9b69fe0968259ee257a8f69a" }
1678+source = { git = "https://github.com/ap29600/tree-sitter-odin", rev = "b219207e49ffca2952529d33e94ed63b1b75c4f1" }
1679
1679
1680[[language]]
1680[[language]]
1681name = "meson"
1681name = "meson"
runtime/queries/odin/highlights.scm+18−133
@@ -1,141 +1,26 @@
1−; Function calls
1+(keyword) @keyword
2+(operator) @operator
2
3
3−(call_expression
4+(int_literal) @constant.numeric.integer
4− function: (identifier) @function)
5+(float_literal) @constant.numeric.float
5−
6+(rune_literal) @constant.character
6−(call_expression
7+(bool_literal) @constant.builtin.boolean
7− function: (selector_expression
8+(nil) @constant.builtin
8− field: (field_identifier) @function))
9−
10−
11−; ; Function definitions
12−
13−(function_declaration
14− name: (identifier) @function)
15−
16−(proc_group
17− (identifier) @function)
18−
19−; ; Identifiers
20−
21−(type_identifier) @type
22−(field_identifier) @variable.other.member
23−(identifier) @variable
24−
25−(const_declaration
26− (identifier) @constant)
27−(const_declaration_with_type
28− (identifier) @constant)
29−
30−"any" @type
31−
32−(directive_identifier) @constant
33−
34−; ; Operators
35−
36−[
37− "?"
38− "-"
39− "-="
40− ":="
41− "!"
42− "!="
43− "*"
44− "*"
45− "*="
46− "/"
47− "/="
48− "&"
49− "&&"
50− "&="
51− "%"
52− "%="
53− "^"
54− "+"
55− "+="
56− "<-"
57− "<"
58− "<<"
59− "<<="
60− "<="
61− "="
62− "=="
63− ">"
64− ">="
65− ">>"
66− ">>="
67− "|"
68− "|="
69− "||"
70− "~"
71− ".."
72− "..<"
73− "..="
74− "::"
75−] @operator
76−
77−; ; Keywords
78−
79−[
80− ; "asm"
81− "auto_cast"
82− ; "bit_set"
83− "cast"
84− ; "context"
85− ; "or_else"
86− ; "or_return"
87− "in"
88− ; "not_in"
89− "distinct"
90− "foreign"
91− "transmute"
92− ; "typeid"
93−
94− "break"
95− "case"
96− "continue"
97− "defer"
98− "else"
99− "using"
100− "when"
101− "where"
102− "fallthrough"
103− "for"
104− "proc"
105− "if"
106− "import"
107− "map"
108− "package"
109− "return"
110− "struct"
111− "union"
112− "enum"
113− "switch"
114− "dynamic"
115−] @keyword
116−
117−; ; Literals
118
9
119−[
10+(type_identifier) @type
120− (interpreted_string_literal)
11+(package_identifier) @namespace
121− (raw_string_literal)
12+(label_identifier) @label
122− (rune_literal)
123−] @string
124
13
14+(interpreted_string_literal) @string
15+(raw_string_literal) @string
125(escape_sequence) @constant.character.escape
16(escape_sequence) @constant.character.escape
126
17
127−(int_literal) @constant.numeric.integer
18+(comment) @comment
128−(float_literal) @constant.numeric.float
19+(const_identifier) @constant
129−(imaginary_literal) @constant.numeric
130
20
131−[
132− (true)
133− (false)
134−] @constant.builtin.boolean
135
21
136−[
22+(compiler_directive) @keyword.directive
137− (nil)
23+(calling_convention) @string.special.symbol
138− (undefined)
139−] @constant.builtin
140
24
141−(comment) @comment.line
25+(identifier) @variable
26+(pragma_identifier) @keyword.directive
runtime/queries/odin/indents.scmnew file+16
@@ -0,0 +1,16 @@
1+[
2+ (foreign_block)
3+ (block)
4+ (compound_literal)
5+ (proc_call)
6+ (assignment_statement)
7+ (const_declaration)
8+ (var_declaration)
9+ (switch_statement)
10+] @indent
11+
12+[
13+ ")"
14+ "}"
15+] @outdent
16+