Просмотр исходного кода

update keywords in textmate syntax (#2953)

keywords were taken from docs/design/lexical_conventions/words.md
Manmeet Singh 2 лет назад
Родитель
Сommit
1646ba1182
2 измененных файлов с 7 добавлено и 2 удалено
  1. 5 0
      docs/design/lexical_conventions/words.md
  2. 2 2
      utils/textmate/Syntaxes/Carbon.plist

+ 5 - 0
docs/design/lexical_conventions/words.md

@@ -34,6 +34,8 @@ in Unicode Normalization Form C (NFC).
 
 ## Keywords
 
+<!-- Keep in sync with utils/textmate/Syntaxes/Carbon.plist -->
+
 The following words are interpreted as keywords:
 
 -   `abstract`
@@ -47,10 +49,12 @@ The following words are interpreted as keywords:
 -   `base`
 -   `break`
 -   `case`
+-   `choice`
 -   `class`
 -   `constraint`
 -   `continue`
 -   `default`
+-   `destructor`
 -   `else`
 -   `extend`
 -   `final`
@@ -81,6 +85,7 @@ The following words are interpreted as keywords:
 -   `return`
 -   `returned`
 -   `Self`
+-   `template`
 -   `then`
 -   `type`
 -   `var`

+ 2 - 2
utils/textmate/Syntaxes/Carbon.plist

@@ -54,14 +54,14 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
                 <key>name</key>
                 <string>keyword.control.carbon</string>
                 <key>match</key>
-                <string>\b(break|case|continue|default|else|if|for|match|return|then|while)\b</string>
+                <string>\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\b</string>
             </dict>
             <!-- Rule: other keywords -->
             <dict>
                 <key>name</key>
                 <string>keyword.other.carbon</string>
                 <key>match</key>
-                <string>\b(abstract|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extends|external|final|forall|fn|friend|impl|import|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|returned|template|var|virtual|where|while|_)\b</string>
+                <string>\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\b</string>
             </dict>
             <!-- Rule: builtin types -->
             <dict>