added: syntax for `union`s
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 23 May 2023 13:48:24 +0000 (08:48 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 23 May 2023 13:48:24 +0000 (08:48 -0500)
misc/onyx-mode.el
misc/onyx.sublime-syntax
misc/onyx.vim
misc/vscode/syntaxes/onyx.tmLanguage

index 338e7c4d74162e9232ebec0cf3870f6ac1fb21d1..429ee64fccf120c2382bb8067819872441dfafa0 100644 (file)
@@ -42,7 +42,7 @@
   '("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"))
 
index 3f917e2857ac40f36b03132a81fc73f48c19d919..fb0b02bd16129492b90a549911b7680841832325 100644 (file)
@@ -32,7 +32,7 @@ contexts:
     # 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'
index 0eb3647a96ba6be7e24a3864ba545195796faf86..c54db382e7f43ecce8d080c6c6234a43e091cf02 100644 (file)
@@ -10,7 +10,7 @@ endif
 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
index aa669a9bb45c05f9b869d115a69a47c1339d94a2..42107e2365f6104100456093747ede5d1501184d 100644 (file)
                                </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>