]> git.lizzy.rs Git - micro.git/commitdiff
Case-insensitive highlighting of hexadecimal constants
authorjohn-batch <70102999+john-batch@users.noreply.github.com>
Sun, 15 Aug 2021 14:00:41 +0000 (16:00 +0200)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 24 Jul 2022 21:03:53 +0000 (14:03 -0700)
runtime/syntax/erb.yaml
runtime/syntax/git-rebase-todo.yaml
runtime/syntax/groovy.yaml
runtime/syntax/html4.yaml
runtime/syntax/html5.yaml
runtime/syntax/objc.yaml
runtime/syntax/php.yaml
runtime/syntax/python3.yaml
runtime/syntax/ruby.yaml
runtime/syntax/vue.yaml

index d58e9b2dad87b9dd408da9b445c9a7b69f0dbafb..fbe420b1058c2ae8200af44110c2b9f79d0f9278 100644 (file)
@@ -1,6 +1,6 @@
 filetype: erb
 
-detect: 
+detect:
     filename: "\\.erb$|\\.rhtml$"
 
 rules:
@@ -12,7 +12,7 @@ rules:
     - symbol: "[:=]"
     - identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
     - constant.string: "\"[^\"]*\""
-    - constant.number: "(?i)#[0-9A-F]{6,6}"
+    - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
     - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^         ]+"
     - comment: "<!--.+?-->"
     - preproc: "<!DOCTYPE.+?>"
index 0d31d13a3378c2cdec5c7b6265e0c404a6d19fd3..724f9c9cb8a3c891722e68fbe2a89dfaf0f41d45 100644 (file)
@@ -7,7 +7,7 @@ rules:
     # Rebase commands
     - statement: "^(p(ick)?|r(eword)?|e(dit)?|s(quash)?|f(ixup)?|x|exec|b(reak)?|d(rop)?|l(abel)?|t|reset|m(erge)?)\\b"
     # Commit IDs
-    - identifier: "\\b([0-9a-f]{7,40})\\b"
+    - identifier: "\\b([0-9a-fA-F]{7,40})\\b"
 
     # Color keywords for Github (and others)
     - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
index eb41331efef9317ecbecf3fd1b72855aae66f581..c8d310c33390a92162e4139d9be8386df30cbde6 100644 (file)
@@ -9,13 +9,13 @@ rules:
     - identifier: "\\b[A-Z_$]+\\b"
     # The style guide for JVM languages is PascalCase for classes and interfaces
     - identifier.class: "\\b[A-Z][a-zA-Z0-9$]+\\b"
-    
+
     # Primitive types
     - type: "\\b(byte|short|int|long|float|double|char|boolean|void)\\b"
-    
+
     # Type-related keywords
     - type.keyword: "\\b(private|public|protected|static|final|var|def)\\b"
-    
+
     # Keywords
     - statement: "\\b(for|while|do|if|else|switch|case|default|try|catch|finally)\\b"
     - statement: "\\b(break|continue|return|throw|assert)\\b"
@@ -23,11 +23,11 @@ rules:
     - statement: "\\b(this|super)\\b"
     # Unsused, but reserved keywords
     - statement: "\\b(goto|const)\\b"
-    
+
     # Operators and punctuation
     - symbol.operator: "[-+*/%=<>^~&|!?:;,.@]|\\b(in|is|as|instanceof|new)\\b"
     - symbol.brackets: "[(){}]|\\[|\\]"
-    
+
     # Decimal integer literal
     - constant.number: "(?i)\\b[1-9]([_0-9]*[0-9])?[GLIDF]?\\b"
     # Binary integer literal
@@ -35,14 +35,14 @@ rules:
     # Octal integer literal
     - constant.number: "(?i)\\b0[0-7]([0-7_]*[0-7])?[GLIDF]?\\b"
     # Hexadecimal integer literal
-    - constant.number: "(?i)\\b0x[0-9a-f]([0-9a-f_]*[0-9a-f])?[GLIDF]?\\b"
+    - constant.number: "(?i)\\b0x[0-9a-fA-F]([0-9a-f_]*[0-9a-fA-F])?[GLIDF]?\\b"
     # Floating-point literal
     - constant.number: "(?i)\\b[0-9]([0-9_]*[0-9])?([.][0-9]([0-9_]*[0-9])?)?(e[+-]?[0-9]([0-9_]*[0-9])?)?[DF]?\\b"
     - constant.bool: "\\b(true|false|null)\\b"
-    
+
     # Annotations
     - identifier: "@[A-Za-z_$][A-Za-z0-9_$]*\\b"
-    
+
     # Single-quoted strings
     - constant.string:
         start: "'"
@@ -50,7 +50,7 @@ rules:
         skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
-    
+
     # This also matches the Triple-double-quoted strings region, but I can't really find a way to mitigate it, all the while still matching "" as a string correctly
     # Also, nesting ${} are never going to be matched correctly with just regex either, so highlighting will break if one is to nest interpolation
     # These two problems combined mean slight mistakes in highlighing that the user is just going to have to deal with
@@ -63,7 +63,7 @@ rules:
             - constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
             - identifier.var: "\\x24[\\w\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+([.][a-zA-Z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+)*"
             - identifier: "\\x24[{].*[}]"
-    
+
     # Triple-double-quoted strings
     - constant.string:
         start: "\"\"\""
@@ -76,7 +76,7 @@ rules:
                 start: "[$][{]"
                 end: "[}]"
                 rules: []
-    
+
     # Triple-single-quoted strings
     - constant.string:
         start: "'''"
@@ -84,28 +84,28 @@ rules:
         skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
-    
+
     # Slashy strings are left out, because they match in unwanted places pretty much all the time
     # Dollar-slashy strings
     - constant.string:
         start: "[$]/"
         end: "/[$]"
         rules: []
-    
+
     # Single-line comments
     - comment:
         start: "//"
         end: "$"
         rules:
             - todo: "(TODO|XXX|FIXME):?"
-    
+
     # Multiline comments
     - comment:
         start: "/[*]"
         end: "[*]/"
         rules:
             - todo: "(TODO|XXX|FIXME):?"
-    
+
     # Groovydoc comments
     - comment:
         start: "/[*][*]@?"
index 7bf851ea8590293890b11624015fa444f1bb454e..c132d61e98aa109e75fb66240224eba43c482923 100644 (file)
@@ -1,6 +1,6 @@
 filetype: html4
 
-detect: 
+detect:
     filename: "\\.htm[l]?4$"
     header: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN|http://www.w3.org/TR/html4/strict.dtd\">"
 
@@ -13,7 +13,7 @@ rules:
     - symbol: "[:=]"
     - identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)="
     - constant.string: "\"[^\"]*\""
-    - constant.number: "(?i)#[0-9A-F]{6,6}"
+    - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
     - default:
         start: ">"
         end: "<"
index bce0ae89caffb6e87c07f8986dc87fe5d651ce93..411d5385814b194e5f996a3e891966f7587d614c 100644 (file)
@@ -1,6 +1,6 @@
 filetype: html5
 
-detect: 
+detect:
     filename: "\\.htm[l]?5$"
     header: "<!DOCTYPE html5>"
 
@@ -13,7 +13,7 @@ rules:
     - symbol: "[:=]"
     - identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)="
     - constant.string: "\"[^\"]*\""
-    - constant.number: "(?i)#[0-9A-F]{6,6}"
+    - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
     - default:
         start: ">"
         end: "<"
index 1a8b7197ec648d071181f4e5b36d79fbeec5521e..223d6929f8da560f2b247c9eb8bd5a0888a05b76 100644 (file)
@@ -25,7 +25,7 @@ rules:
 
     - statement: "([.:;,+*|=!\\%\\[\\]]|<|>|/|-|&)"
 
-    - constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b)"
+    - constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9a-fA-F]+\\b)"
     - constant: "(@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\))"
     - constant: "\\b<(\\\\.[^\\>])*\\>\\b"
     - constant: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\\b"
@@ -57,4 +57,3 @@ rules:
         end: "\\*/"
         rules:
             - todo: "(TODO|XXX|FIXME):?"
-
index a4e20dec3b0d19ecff132e65889a04d9d2a8bd44..7488be3c0ddce60435893d7b4e90aa5cea869c17 100644 (file)
@@ -12,7 +12,7 @@ rules:
     - special: "&[^;[[:space:]]]*;"
     - symbol: "[:=]"
     - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
-    - constant.number: "(?i)#[0-9A-F]{6,6}"
+    - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
     - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^         ]+"
     - comment: "<!--.+?-->"
     - default: "<\\?(php|=)\" end=\"\\?>"
index 93f4f483002b449a2705c848e3d678eb244f5c01..f84d536e49acb9243d50ec2d6bc97bcb6f4475f1 100644 (file)
@@ -29,7 +29,7 @@ rules:
     - constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
     - constant.number: "\\b0b(_?[01])+\\b"     # bin
     - constant.number: "\\b0o(_?[0-7])+\\b"    # oct
-    - constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
+    - constant.number: "\\b0x(_?[0-9a-fA-F])+\\b" # hex
 
     - constant.string:
         start: "\"\"\""
index c55feb4b6999c1e75faae139abe1cbdbdd3d2f8c..f1f9e2a2872bd49067b8d0b3c1b6267aad27f193 100644 (file)
@@ -18,7 +18,7 @@ rules:
 
     - statement: "\\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|for|if|in|module|next|nil|not|or|private|protected|public|redo|rescue|retry|return|self|super|then|undef|unless|until|when|while|yield)\\b"
     - constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
-    - constant.number: "(?i)\\b0x[0-9a-f][0-9a-f_]*\\b"
+    - constant.number: "(?i)\\b0x[0-9a-fA-F][0-9a-f_]*\\b"
     - constant.number: "(?i)\\b0b[01][01_]*\\b"
     - constant.number: "(?i)\\b[0-9][0-9_]*(['.'][0-9_]+)?(e[\\-]?[0-9_]+)?\\b"
     # Ruby "Symbols"
index a505ca4056a8ed750a35e75f50e487b7b04db7a7..d5e10c34febd6e1364f24f50e84e3e04aa2c02ab 100644 (file)
@@ -11,14 +11,14 @@ rules:
         rules:
             - error: "<[^!].*?>"
             - symbol.tag: "(?i)<[/]?(a|a(bbr|ddress|rea|rticle|side|udio)|b|b(ase|d(i|o)|lockquote|r|utton)|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata|atalist|d|el|etails|fn|ialog|l|t)|em|embed|fieldset|fig(caption|ure)|form|iframe|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li|link|ma(in|p|rk)|menu|menuitem|met(a|er)|nav|noscript|o(bject|l|pt(group|ion)|utput)|p|param|picture|pre|progress|q|r(p|t|uby)|s|samp|se(ction|lect)|svg|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u|ul|var|video|wbr)( .*)*?>"
-            - symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>"                        
+            - symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>"
             - preproc: "(?i)<[/]?(script|style)( .*)*?>"
             - special: "&[^;[[:space:]]]*;"
-            
+
             - identifier: "(alt|bgcolor|class|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|placeholder|size|span|src|style|target|type|value|width)="
             - symbol: "[:=]"
             - constant.string: "\"[^\"]*\""
-            - constant.number: "(?i)#[0-9A-F]{6,6}"
+            - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
 
             - symbol.tag: "<|>"
             - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^         ]+"
@@ -41,27 +41,24 @@ rules:
             - symbol.tag.extended: "(?i)<[/]?(router-link|router-view)\\b"
             - identifier: "(to|v-slot)="
             - symbol: "[:=]"
-            
 
-    - default: 
+
+    - default:
         start: "<script>"
         end: "</script>"
         limit-group: symbol.tag
         rules:
             - include: "javascript"
 
-    - default: 
+    - default:
         start: "<script[ ]+lang=(\"ts\"|'ts')>"
         end: "</script>"
         rules:
             - include: "typescript"
-    
+
     - default:
         start: "<style.*?>"
         end: "</style.*?>"
         limit-group: symbol.tag
         rules:
             - include: "css"
-
-