fixed: syntax highlighting for new keywords
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 5 Feb 2024 14:52:33 +0000 (08:52 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 5 Feb 2024 14:52:33 +0000 (08:52 -0600)
misc/onyx-mode.el
misc/onyx.sublime-syntax
misc/onyx.vim
misc/vscode/syntaxes/onyx.tmLanguage

index 429ee64fccf120c2382bb8067819872441dfafa0..14644eb03c3c3c3785882148f038173145f6dcea 100644 (file)
@@ -42,7 +42,7 @@
   '("cast" "it" "sizeof" "alignof" "typeof"))
 
 (defconst onyx-keywords
-  '("if" "elseif" "else" "do" "while" "for" "switch" "case" "struct" "enum" "union"
+  '("if" "elseif" "else" "do" "while" "for" "in" "switch" "case" "as" "struct" "enum" "union"
     "return" "continue" "break" "fallthrough" "defer" "macro" "package"
     "use" "interface" "where"))
 
index 45df1802322d5a1780e2fdae7b0fc17669ffa840..d5a6ee6840eb27058ff5affab67e4d8814aa4798 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|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'
+    - 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|in|as)\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 c54db382e7f43ecce8d080c6c6234a43e091cf02..a735787244cd8586654a07b84e97714de298cbb9 100644 (file)
@@ -12,8 +12,8 @@ set cpo&vim
 
 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
+syn keyword onyxKeyword for in while do
+syn keyword onyxKeyword switch case as
 syn keyword onyxKeyword break continue return defer fallthrough
 syn keyword onyxKeyword cast sizeof alignof typeof
 syn keyword onyxType bool void
index 80a1feec6c8e6277218ec0d31e8d73e703f73254..5e59cd050ed4506f5300afc82118ccbb34cda926 100644 (file)
                        <array>
                                <dict>
                                        <key>match</key>
-                                       <string>\b(if|else|elseif|for|while|defer|return|do)\b</string>
+                                       <string>\b(if|else|elseif|for|in|while|defer|return|do)\b</string>
                                        <key>name</key>
                                        <string>keyword.control.onyx</string>
                                </dict>
                                <dict>
                                        <key>match</key>
-                    <string>\b(break|continue|fallthrough|switch|case)\b</string>
+                    <string>\b(break|continue|fallthrough|switch|case|as)\b</string>
                                        <key>name</key>
                                        <string>keyword.control.onyx</string>
                                </dict>