'("cast" "it" "sizeof" "alignof" "typeof"))
(defconst onyx-keywords
- '("if" "elseif" "else" "do" "while" "for" "switch" "case" "struct" "enum"
+ '("if" "elseif" "else" "do" "while" "for" "switch" "case" "struct" "enum" "union"
"return" "continue" "break" "fallthrough" "defer" "macro" "package"
"use" "interface" "where"))
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- - match: '\b(package|struct|interface|use|where|global|enum|if|elseif|else|for|while|do|break|continue|fallthrough|return|cast|sizeof|alignof|typeof|defer|switch|case|macro)\b'
+ - match: '\b(package|struct|union|interface|use|where|global|enum|if|elseif|else|for|while|do|break|continue|fallthrough|return|cast|sizeof|alignof|typeof|defer|switch|case|macro)\b'
scope: keyword.control.onyx
- match: '\b(bool|void|i8|u8|i16|u16|i32|u32|i64|u64|f32|f64|rawptr|str|cstr|dyn_str|range|type_expr|any)\b'
let s:cpo_save = &cpo
set cpo&vim
-syn keyword onyxKeyword package struct enum use global macro
+syn keyword onyxKeyword package struct union enum use global macro
syn keyword onyxKeyword if elseif else where interface
syn keyword onyxKeyword for while do
syn keyword onyxKeyword switch case
</dict>
<dict>
<key>match</key>
- <string>\b(struct|enum|interface)\b</string>
+ <string>\b(union|struct|enum|interface)\b</string>
<key>name</key>
<string>storage.type.onyx</string>
</dict>
<array>
<dict>
<key>match</key>
- <string>\b(struct|enum|interface)\b(?:(\{)(\}))?</string>
+ <string>\b(union|struct|enum|interface)\b(?:(\{)(\}))?</string>
<key>name</key>
<string>storage.type.onyx</string>
</dict>
</dict>
<dict>
<key>match</key>
- <string>\b(\b[[:alpha:]_]+[[:alnum:]_]*\b)\s*[:]\s*[:]\s*(struct)</string>
+ <string>\b(\b[[:alpha:]_]+[[:alnum:]_]*\b)\s*[:]\s*[:]\s*(union|struct)</string>
<key>captures</key>
<dict>
<key>1</key>