[gtksourceview: 4/13] javascript.lang, typescript.lang: Add once-only="true" for contexts



commit 949902425b84a9f15647b950bf6602c823b823dd
Author: Jeffery To <jeffery to gmail com>
Date:   Sun May 31 07:49:42 2020 +0800

    javascript.lang, typescript.lang: Add once-only="true" for contexts
    
    This adds once-only="true" for certain (keyword) contexts that should
    only match once.

 data/language-specs/javascript-functions-classes.lang    |  4 ++--
 data/language-specs/typescript-js-functions-classes.lang |  4 ++--
 data/language-specs/typescript-type-expressions.lang     | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/data/language-specs/javascript-functions-classes.lang 
b/data/language-specs/javascript-functions-classes.lang
index 80dd6b28..666b45df 100644
--- a/data/language-specs/javascript-functions-classes.lang
+++ b/data/language-specs/javascript-functions-classes.lang
@@ -43,7 +43,7 @@
 
     <!-- ## Function expression keyword -->
 
-    <context id="_function-expression-async-keyword" style-ref="js:keyword">
+    <context id="_function-expression-async-keyword" style-ref="js:keyword" once-only="true">
       <keyword>async</keyword>
     </context> <!-- /_function-expression-async-keyword -->
 
@@ -55,7 +55,7 @@
       </include>
     </context> <!-- /_ordered-function-expression-async-keyword -->
 
-    <context id="_function-expression-function-keyword" style-ref="js:keyword">
+    <context id="_function-expression-function-keyword" style-ref="js:keyword" once-only="true">
       <keyword>function</keyword>
     </context> <!-- /_function-expression-function-keyword -->
 
diff --git a/data/language-specs/typescript-js-functions-classes.lang 
b/data/language-specs/typescript-js-functions-classes.lang
index ca07e551..b72c977f 100644
--- a/data/language-specs/typescript-js-functions-classes.lang
+++ b/data/language-specs/typescript-js-functions-classes.lang
@@ -170,7 +170,7 @@
 
     <!-- ## Class expression keyword -->
 
-    <context id="_class-expression-abstract-keyword" style-ref="js:keyword">
+    <context id="_class-expression-abstract-keyword" style-ref="js:keyword" once-only="true">
       <keyword>abstract</keyword>
     </context> <!-- /_class-expression-abstract-keyword -->
 
@@ -182,7 +182,7 @@
       </include>
     </context> <!-- /_ordered-class-expression-abstract-keyword -->
 
-    <context id="_class-expression-class-keyword" style-ref="js:keyword">
+    <context id="_class-expression-class-keyword" style-ref="js:keyword" once-only="true">
       <keyword>class</keyword>
     </context> <!-- /_class-expression-class-keyword -->
 
diff --git a/data/language-specs/typescript-type-expressions.lang 
b/data/language-specs/typescript-type-expressions.lang
index fc42ee35..558ce1a0 100644
--- a/data/language-specs/typescript-type-expressions.lang
+++ b/data/language-specs/typescript-type-expressions.lang
@@ -71,15 +71,15 @@
         <context ref="typescript:constructor-modifier"/>
         <context ref="typescript-type-gen:type-parameters-list"/>
 
-        <context id="_asserts-type-predicates" style-ref="typescript:type-keyword">
+        <context id="_asserts-type-predicate" style-ref="typescript:type-keyword" once-only="true">
           <keyword>asserts</keyword>
-        </context> <!-- /_asserts-type-predicates -->
+        </context> <!-- /_asserts-type-predicate -->
 
-        <context id="_indexed-type-queries" style-ref="typescript:type-keyword">
+        <context id="_indexed-type-query" style-ref="typescript:type-keyword" once-only="true">
           <keyword>keyof</keyword>
-        </context> <!-- /_indexed-type-queries -->
+        </context> <!-- /_indexed-type-query -->
 
-        <context id="_readonly-type-modifier" style-ref="typescript:type-keyword">
+        <context id="_readonly-type-modifier" style-ref="typescript:type-keyword" once-only="true">
           <keyword>readonly</keyword>
         </context> <!-- /_readonly-type-modifier -->
 


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