@@ -83,8 +83,12 @@ contexts:
8383 scope : keyword.function.odin
8484 - match : ' ([#]\s*{{identifier}})'
8585 scope : keyword.tag.odin
86- - match : ' (#\+\s*[[:alpha:]-][[:alnum:]-]*).*'
86+
87+ # file tags such as #+build -- Note the special rule for comments. File tags
88+ # don't follow normal grammar rules.
89+ - match : ' (#\+\s*)(.*(?=(//|/\*))|.*)'
8790 scope : keyword.tag.odin
91+
8892 - match : ' (\x40\s*{{identifier}})'
8993 scope : keyword.tag.odin
9094 - match : ' (\x40\s*[(]\s*{{identifier}})\s*[)]'
@@ -93,24 +97,28 @@ contexts:
9397 scope : keyword.operator.odin
9498 - match : ' (\(|\)|\{|\}|\[|\]|,|;)'
9599 scope : punctuation.separator.odin
100+
101+ # TODO: & should work as bit-wise operator too. Needs some special case to
102+ # make it into `keyword.operator.odin`. Probably needs some smarter scoping.
96103 - match : ' (\&|\^|\.)'
97104 scope : punctuation.accessor.odin
105+
98106 # - match: '(\$)'
99107 # scope: keyword.generic.odin
100108
101109 functions-and-declarations :
102110 - match : ' \b({{identifier}})\s*(:)\s*(:)\s*(proc)'
103111 captures :
104112 1 : meta.function.odin entity.name.function.odin
105- 2 : punctuation.separator .odin
106- 3 : punctuation.separator .odin
113+ 2 : keyword.operator .odin
114+ 3 : keyword.operator .odin
107115 4 : storage.type.odin
108116
109117 - match : ' \b({{identifier}})\s*(:)\s*(:)\s*([#]force_inline|[#]force_no_inline)\s+(proc)'
110118 captures :
111119 1 : meta.function.odin entity.name.function.odin
112- 2 : punctuation.separator .odin
113- 3 : punctuation.separator .odin
120+ 2 : keyword.operator .odin
121+ 3 : keyword.operator .odin
114122 4 : keyword.control.odin
115123 5 : storage.type.odin
116124
@@ -133,8 +141,8 @@ contexts:
133141 - match : ' \b({{identifier}})\s*(:)\s*(:)\s*(struct|union|enum|bit_set)'
134142 captures :
135143 1 : meta.type.odin entity.name.type.odin
136- 2 : punctuation.separator .odin
137- 3 : punctuation.separator .odin
144+ 2 : keyword.operator .odin
145+ 3 : keyword.operator .odin
138146 4 : storage.type.odin
139147
140148 - match : ' \b({{identifier}})\s*(:)\s*(:)\s*([#]\s*type)'
0 commit comments