[gtksourceview: 11/13] less.lang: Use own identifier regex



commit 0a2b10e8f1cf4841a3a4a7cb598c40d98dc0d2fa
Author: Jeffery To <jeffery to gmail com>
Date:   Tue Dec 10 04:50:18 2019 +0800

    less.lang: Use own identifier regex
    
    Less identifiers (for variable/function names) do not appear to allow
    the same characters as CSS identifiers.

 data/language-specs/less.lang | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/data/language-specs/less.lang b/data/language-specs/less.lang
index 26aa9afa..f84d43b8 100644
--- a/data/language-specs/less.lang
+++ b/data/language-specs/less.lang
@@ -61,6 +61,7 @@
 
     <!-- global -->
 
+    <define-regex id="identifier">[\w-]+</define-regex>
     <define-regex id="statement-end" extended="true">;|(?=})</define-regex>
 
     <context id="embedded-lang-hook"/>
@@ -94,12 +95,8 @@
 
     <!-- variables -->
 
-    <define-regex id="variable" extended="true">
-      @ \%{css:identifier}
-    </define-regex>
-
     <context id="variable" style-ref="variable">
-      <match>\%{variable}</match>
+      <match>@\%{identifier}</match>
     </context>
 
     <context id="variable-interpolation" style-ref="variable">
@@ -115,11 +112,11 @@
     </context>
 
     <context id="variable-reference" style-ref="variable">
-      <match>@@\%{css:identifier}</match>
+      <match>@@\%{identifier}</match>
     </context>
 
     <context id="property-variable" style-ref="variable">
-      <match>\$\%{css:identifier}</match>
+      <match>\$\%{identifier}</match>
     </context>
 
     <context id="arguments-variable" style-ref="built-in-variable">
@@ -215,7 +212,7 @@
     </context>
 
     <context id="detached-ruleset-call">
-      <start>\%{variable}\(</start>
+      <start>@\%{identifier}\(</start>
       <end>\%{statement-end}</end>
       <include>
         <context sub-pattern="0" where="start" style-ref="variable"/>
@@ -513,7 +510,7 @@
     </context>
 
     <context id="standalone-plugin-function-call">
-      <start>(?=\%{css:identifier}\()</start>
+      <start>(?=\%{identifier}\()</start>
       <end>\%{statement-end}</end>
       <include>
         <context sub-pattern="0" where="end" style-ref="css:delimiter"/>


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