[gtksourceview: 7/13] javascript.lang, typescript.lang: Use <match> for single keyword contexts



commit 74c1338987080eb9f2f47073636cc00715e0c83a
Author: Jeffery To <jeffery to gmail com>
Date:   Sun May 31 06:32:27 2020 +0800

    javascript.lang, typescript.lang: Use <match> for single keyword contexts
    
    This replaces keyword contexts (<keyword>) with simple contexts
    (<match>) when the context should match only one keyword.
    
    Keyword contexts that currently match one keyword only but can match
    additional keywords in the future are unchanged.

 data/language-specs/javascript-functions-classes.lang    | 4 ++--
 data/language-specs/javascript-literals.lang             | 2 +-
 data/language-specs/typescript-js-functions-classes.lang | 4 ++--
 data/language-specs/typescript-js-modules.lang           | 2 +-
 data/language-specs/typescript-type-expressions.lang     | 8 ++++----
 data/language-specs/typescript.lang                      | 2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/data/language-specs/javascript-functions-classes.lang 
b/data/language-specs/javascript-functions-classes.lang
index 666b45df..81dd7ee9 100644
--- a/data/language-specs/javascript-functions-classes.lang
+++ b/data/language-specs/javascript-functions-classes.lang
@@ -44,7 +44,7 @@
     <!-- ## Function expression keyword -->
 
     <context id="_function-expression-async-keyword" style-ref="js:keyword" once-only="true">
-      <keyword>async</keyword>
+      <match>\%[async\%]</match>
     </context> <!-- /_function-expression-async-keyword -->
 
     <context id="_ordered-function-expression-async-keyword" once-only="true">
@@ -56,7 +56,7 @@
     </context> <!-- /_ordered-function-expression-async-keyword -->
 
     <context id="_function-expression-function-keyword" style-ref="js:keyword" once-only="true">
-      <keyword>function</keyword>
+      <match>\%[function\%]</match>
     </context> <!-- /_function-expression-function-keyword -->
 
     <context id="_ordered-function-expression-function-keyword" once-only="true">
diff --git a/data/language-specs/javascript-literals.lang b/data/language-specs/javascript-literals.lang
index 0ac51209..59537cf7 100644
--- a/data/language-specs/javascript-literals.lang
+++ b/data/language-specs/javascript-literals.lang
@@ -39,7 +39,7 @@
 
     <!-- <NullLiteral> -->
     <context id="null-value" style-ref="js:null-value">
-      <keyword>null</keyword>
+      <match>\%[null\%]</match>
     </context> <!-- /null-value -->
 
     <!-- <BooleanLiteral> -->
diff --git a/data/language-specs/typescript-js-functions-classes.lang 
b/data/language-specs/typescript-js-functions-classes.lang
index b72c977f..086cf20a 100644
--- a/data/language-specs/typescript-js-functions-classes.lang
+++ b/data/language-specs/typescript-js-functions-classes.lang
@@ -171,7 +171,7 @@
     <!-- ## Class expression keyword -->
 
     <context id="_class-expression-abstract-keyword" style-ref="js:keyword" once-only="true">
-      <keyword>abstract</keyword>
+      <match>\%[abstract\%]</match>
     </context> <!-- /_class-expression-abstract-keyword -->
 
     <context id="_ordered-class-expression-abstract-keyword" once-only="true">
@@ -183,7 +183,7 @@
     </context> <!-- /_ordered-class-expression-abstract-keyword -->
 
     <context id="_class-expression-class-keyword" style-ref="js:keyword" once-only="true">
-      <keyword>class</keyword>
+      <match>\%[class\%]</match>
     </context> <!-- /_class-expression-class-keyword -->
 
     <context id="_ordered-class-expression-class-keyword" once-only="true">
diff --git a/data/language-specs/typescript-js-modules.lang b/data/language-specs/typescript-js-modules.lang
index 689d2124..c3b5296a 100644
--- a/data/language-specs/typescript-js-modules.lang
+++ b/data/language-specs/typescript-js-modules.lang
@@ -39,7 +39,7 @@
     -->
 
     <context id="_export-as-namespace-keyword" style-ref="js:keyword" once-only="true">
-      <keyword>namespace</keyword>
+      <match>\%[namespace\%]</match>
     </context> <!-- /_export-as-namespace-keyword -->
 
     <context id="_ordered-export-as-namespace-keyword" once-only="true">
diff --git a/data/language-specs/typescript-type-expressions.lang 
b/data/language-specs/typescript-type-expressions.lang
index a3cedbbf..9f3c34c3 100644
--- a/data/language-specs/typescript-type-expressions.lang
+++ b/data/language-specs/typescript-type-expressions.lang
@@ -72,21 +72,21 @@
         <context ref="typescript-type-gen:type-parameters-list"/>
 
         <context id="_asserts-type-predicate" style-ref="typescript:type-keyword" once-only="true">
-          <keyword>asserts</keyword>
+          <match>\%[asserts\%]</match>
         </context> <!-- /_asserts-type-predicate -->
 
         <context id="_indexed-type-query" style-ref="typescript:type-keyword" once-only="true">
-          <keyword>keyof</keyword>
+          <match>\%[keyof\%]</match>
         </context> <!-- /_indexed-type-query -->
 
         <context id="_readonly-type-modifier" style-ref="typescript:type-keyword" once-only="true">
-          <keyword>readonly</keyword>
+          <match>\%[readonly\%]</match>
         </context> <!-- /_readonly-type-modifier -->
 
         <!-- for unique symbol subtype, can contain newlines between
              "unique" and "symbol" -->
         <context id="_unique-symbol-subtype" style-ref="typescript:basic-type" once-only="true">
-          <keyword>unique</keyword>
+          <match>\%[unique\%]</match>
         </context> <!-- /_unique-symbol-subtype -->
 
       </include>
diff --git a/data/language-specs/typescript.lang b/data/language-specs/typescript.lang
index f3a25c52..0b182830 100644
--- a/data/language-specs/typescript.lang
+++ b/data/language-specs/typescript.lang
@@ -324,7 +324,7 @@
           <include>
 
             <context id="_choice-this-parameter" style-ref="js:keyword" end-parent="true">
-              <keyword>this</keyword>
+              <match>\%[this\%]</match>
             </context> <!-- /_choice-this-parameter -->
 
             <context id="_js-choice-binding" end-parent="true">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]