浏览代码

Add new 'where' keyword to Numbat syntaxes

David Peter 1 年之前
父节点
当前提交
2f80ce8bb9
共有 5 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      assets/articles/index.js
  2. 1 1
      assets/numbat.sublime-syntax
  3. 1 1
      assets/numbat.vim
  4. 1 1
      book/numbat.js
  5. 1 1
      vscode-extension/syntaxes/numbat.tmLanguage.json

+ 1 - 1
assets/articles/index.js

@@ -54,7 +54,7 @@ ace.define(
           {
           {
             token: "keyword",
             token: "keyword",
             regex:
             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",
             token: "constant.numeric",

+ 1 - 1
assets/numbat.sublime-syntax

@@ -7,7 +7,7 @@ file_extensions:
 scope: source.nbt
 scope: source.nbt
 contexts:
 contexts:
   main:
   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
       scope: keyword.control.nbt
     - match: '#(.*)'
     - match: '#(.*)'
       scope: comment.line.nbt
       scope: comment.line.nbt

+ 1 - 1
assets/numbat.vim

@@ -5,7 +5,7 @@ if exists("b:current_syntax")
 endif
 endif
 
 
 " Numbat Keywords
 " 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
 highlight default link numbatKeywords Keyword
 
 
 " Physical dimensions (every capitalized word)
 " Physical dimensions (every capitalized word)

+ 1 - 1
book/numbat.js

@@ -4,7 +4,7 @@ hljs.registerLanguage('numbat', function(hljs) {
     aliases: ['nbt'],
     aliases: ['nbt'],
     case_insensitive: false,
     case_insensitive: false,
     keywords: {
     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: [
     contains: [
       hljs.HASH_COMMENT_MODE,
       hljs.HASH_COMMENT_MODE,

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

@@ -32,7 +32,7 @@
             "patterns": [
             "patterns": [
                 {
                 {
                     "name": "keyword.control.numbat",
                     "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"
                 }
                 }
             ]
             ]
         },
         },