Pārlūkot izejas kodu

Add new 'where' keyword to Numbat syntaxes

David Peter 1 gadu atpakaļ
vecāks
revīzija
2f80ce8bb9

+ 1 - 1
assets/articles/index.js

@@ -54,7 +54,7 @@ ace.define(
           {
             token: "keyword",
             regex:
-              "\\b(?:per|to|let|fn|dimension|unit|use|long|short|both|none|print|assert|assert_eq|type|if|then|else|true|false)\\b",
+              "\\b(?:per|to|let|fn|where|dimension|unit|use|long|short|both|none|print|assert|assert_eq|type|if|then|else|true|false)\\b",
           },
           {
             token: "constant.numeric",

+ 1 - 1
assets/numbat.sublime-syntax

@@ -7,7 +7,7 @@ file_extensions:
 scope: source.nbt
 contexts:
   main:
-    - match: \b(per|to|let|fn|dimension|unit|use|struct|long|short|both|none|if|then|else|true|false|print|assert|assert_eq|type)\b
+    - match: \b(per|to|let|fn|where|dimension|unit|use|struct|long|short|both|none|if|then|else|true|false|print|assert|assert_eq|type)\b
       scope: keyword.control.nbt
     - match: '#(.*)'
       scope: comment.line.nbt

+ 1 - 1
assets/numbat.vim

@@ -5,7 +5,7 @@ if exists("b:current_syntax")
 endif
 
 " Numbat Keywords
-syn keyword numbatKeywords per to let fn dimension unit use struct long short both none if then else true false NaN inf print assert assert_eq type
+syn keyword numbatKeywords per to let fn where dimension unit use struct long short both none if then else true false NaN inf print assert assert_eq type
 highlight default link numbatKeywords Keyword
 
 " Physical dimensions (every capitalized word)

+ 1 - 1
book/numbat.js

@@ -4,7 +4,7 @@ hljs.registerLanguage('numbat', function(hljs) {
     aliases: ['nbt'],
     case_insensitive: false,
     keywords: {
-      keyword: 'per to let fn dimension unit use struct long short both none if then else true false print assert assert_eq type',
+      keyword: 'per to let fn where dimension unit use struct long short both none if then else true false print assert assert_eq type',
     },
     contains: [
       hljs.HASH_COMMENT_MODE,

+ 1 - 1
vscode-extension/syntaxes/numbat.tmLanguage.json

@@ -32,7 +32,7 @@
             "patterns": [
                 {
                     "name": "keyword.control.numbat",
-                    "match": "\\b(per|to|let|fn|dimension|unit|use|struct|long|short|both|none|if|then|else|true|false|print|assert|assert_eq|type)\\b"
+                    "match": "\\b(per|to|let|fn|where|dimension|unit|use|struct|long|short|both|none|if|then|else|true|false|print|assert|assert_eq|type)\\b"
                 }
             ]
         },