[gtksourceview] html.lang: attribute-name regex



commit 30cfe8bd57ac12c145fdc1dea83c5efcd46975d8
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Feb 8 22:18:37 2014 +0100

    html.lang: attribute-name regex
    
    The regex was duplicated.
    Note: the regex in html.lang are case insensitive, so the A-Z is
    useless.

 data/language-specs/html.lang |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/data/language-specs/html.lang b/data/language-specs/html.lang
index 1b881db..c487fa7 100644
--- a/data/language-specs/html.lang
+++ b/data/language-specs/html.lang
@@ -164,15 +164,13 @@
       </include>
     </context>
 
+    <define-regex id="attribute-name">[a-z0-9:_-]+</define-regex>
+
     <context id="generic-tag">
       <include>
         <!-- Attribute in the form: name="value" -->
         <context id="attrib-quoted" class="no-spell-check">
-          <start extended="true">
-            ([A-Za-z0-9:_-]+ # attribute name
-            \s*=\s*)         # "="
-            (\")             # string beginning
-          </start>
+          <start>(\%{attribute-name}\s*=\s*)(\")</start>
           <include>
             <context sub-pattern="1" where="start" style-ref="attrib-name"/>
             <context sub-pattern="2" where="start" style-ref="attrib-value"/>
@@ -190,10 +188,7 @@
 
         <!-- Attribute in the form: name=value -->
         <context id="attrib-unquoted" style-ref="attrib-value" class="no-spell-check">
-          <start extended="true">
-            [a-z0-9:_-]+ # attribute name
-            \s*=\s*      # "="
-          </start>
+          <start>\%{attribute-name}\s*=\s*</start>
           <end>(?=&gt;|\s)</end>
           <include>
             <context sub-pattern="0" where="start" style-ref="attrib-name"/>
@@ -205,9 +200,7 @@
 
         <!-- Attribute in the form: name -->
         <context id="attrib-no-value" style-ref="attrib-name" class="no-spell-check">
-          <match extended="true">
-            [a-z0-9:_-]+  # attribute name
-          </match>
+          <match>\%{attribute-name}</match>
         </context>
 
         <context ref="embedded-lang-hook"/>


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