From d949b58fc0a30b1d255abe8761fb4d8f417bade8 Mon Sep 17 00:00:00 2001 From: CaptainMcClellan Date: Fri, 3 Mar 2017 10:47:03 -0600 Subject: [PATCH] Legacy syntax overhaul 2 (#577) * Added title setting (Requires tcell pull!) and optimized tab display. * Added Clojure highlighting. * Changed tcell call to screen. * Fixed bad reference for getting Buffer name. * Yet another massive syntax overhaul * Tweaking and testing web syntax * More webdev goodies * Added html5 highlighting and strict html4 highlighting. * Documentation update --- runtime/colorschemes/cmc-16.micro | 1 + runtime/help/colors.md | 1 + runtime/syntax/README.md | 2 +- runtime/syntax/arduino.micro | 2 +- runtime/syntax/awk.micro | 4 +-- runtime/syntax/c++.micro | 2 +- runtime/syntax/c.micro | 5 ++-- runtime/syntax/clojure.micro | 29 +++++++++++++++++++ runtime/syntax/coffeescript.micro | 3 +- runtime/syntax/crystal.micro | 2 +- runtime/syntax/csharp.micro | 4 +-- runtime/syntax/css.micro | 15 ++++++---- runtime/syntax/dot.micro | 2 +- runtime/syntax/erb.micro | 22 ++++++++++++-- runtime/syntax/fish.micro | 10 +++++-- runtime/syntax/git-config.micro | 3 +- runtime/syntax/glsl.micro | 6 ++-- runtime/syntax/go.micro | 2 +- runtime/syntax/golo.micro | 2 +- runtime/syntax/html.micro | 25 ++++++++++------ runtime/syntax/html4.micro | 21 ++++++++++++++ runtime/syntax/html5.micro | 23 +++++++++++++++ runtime/syntax/ini.micro | 3 +- runtime/syntax/java.micro | 2 +- runtime/syntax/javascript.micro | 8 +++--- runtime/syntax/json.micro | 6 ++-- runtime/syntax/keymap.micro | 2 +- runtime/syntax/ledger.micro | 2 +- runtime/syntax/lfe.micro | 9 +++--- runtime/syntax/lilypond.micro | 2 +- runtime/syntax/lisp.micro | 4 +-- runtime/syntax/lua.micro | 5 +--- runtime/syntax/markdown.micro | 4 +-- runtime/syntax/micro.micro | 10 +++++-- runtime/syntax/nginx.micro | 3 +- runtime/syntax/objc.micro | 5 ++-- runtime/syntax/ocaml.micro | 2 +- runtime/syntax/pascal.micro | 4 +-- runtime/syntax/perl.micro | 2 +- runtime/syntax/php.micro | 48 +++++++++++++++++++++++++------ runtime/syntax/pony.micro | 2 +- runtime/syntax/puppet.micro | 2 +- runtime/syntax/python2.micro | 7 ++++- runtime/syntax/python3.micro | 11 +++++-- runtime/syntax/reST.micro | 41 +++++++++++++++++--------- runtime/syntax/ruby.micro | 4 ++- runtime/syntax/scala.micro | 2 +- runtime/syntax/sh.micro | 3 ++ runtime/syntax/sls.micro | 2 +- runtime/syntax/sql.micro | 44 ++++++++++++++-------------- runtime/syntax/swift.micro | 4 +-- runtime/syntax/typescript.micro | 8 +++--- runtime/syntax/vala.micro | 2 +- runtime/syntax/vhdl.micro | 2 +- runtime/syntax/zsh.micro | 3 ++ 55 files changed, 311 insertions(+), 133 deletions(-) create mode 100644 runtime/syntax/clojure.micro create mode 100644 runtime/syntax/html4.micro create mode 100644 runtime/syntax/html5.micro diff --git a/runtime/colorschemes/cmc-16.micro b/runtime/colorschemes/cmc-16.micro index 45cc500b..a7fc47d0 100644 --- a/runtime/colorschemes/cmc-16.micro +++ b/runtime/colorschemes/cmc-16.micro @@ -18,6 +18,7 @@ color-link statement "bold yellow" color-link symbol "red" color-link symbol.brackets "blue" color-link symbol.tag "bold blue" +color-link symbol.tag.extended "bold green" color-link preproc "bold cyan" color-link type "green" color-link type.keyword "bold green" diff --git a/runtime/help/colors.md b/runtime/help/colors.md index 4c48370e..ca0696e7 100644 --- a/runtime/help/colors.md +++ b/runtime/help/colors.md @@ -182,6 +182,7 @@ Here's a list of subgroups used in micro's built-in syntax files. * identifier.class ( Also used for functions. ) * identifier.macro * identifier.var +* preproc.shebang ( The #! at the beginning of a file that tells the os what script interpreter to use. ) * symbol.brackets ( {}()[] and sometimes <> ) * symbol.operator ( Color operator symbols differently. ) * symbol.tag ( For html tags, among other things.) diff --git a/runtime/syntax/README.md b/runtime/syntax/README.md index 14243150..c3339ed9 100644 --- a/runtime/syntax/README.md +++ b/runtime/syntax/README.md @@ -7,7 +7,7 @@ They are taken from Nano, specifically from [this repository](https://github.com Micro syntax files are almost identical to Nano's, except for some key differences: * Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`i`) in the regular expression - * For example, `icolor green ".*"` would become `color green (i) ".*"` + * For example, `icolor green ".*"` would become `color green "(?i).*"` # Using with colorschemes diff --git a/runtime/syntax/arduino.micro b/runtime/syntax/arduino.micro index 647e43c8..821beed1 100644 --- a/runtime/syntax/arduino.micro +++ b/runtime/syntax/arduino.micro @@ -86,7 +86,7 @@ color statement "\b(interrupts|noInterrupts)\b" color statement "\b(noTone|pulseIn|shiftIn|shiftOut|tone)\b" ## Serial -color special "b<(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\b" +color special "\b(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\b" ## Structure color statement "\b(setup|loop)\b" diff --git a/runtime/syntax/awk.micro b/runtime/syntax/awk.micro index 2f97c76e..8c43b79d 100644 --- a/runtime/syntax/awk.micro +++ b/runtime/syntax/awk.micro @@ -1,12 +1,12 @@ syntax "awk" "\.awk$" header "^#!.*bin/(env +)?awk( |$)" -color preproc "\$[A-Za-z0-9_!@#$*?-]+" +color preproc "\$[A-Za-z0-9_!@#$*?\-]+" color preproc "\b(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\b" color preproc "\b(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\b" color preproc "\b(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\b" color identifier.class "\b(function|extension|BEGIN|END)\b" -color symbol.operator "[-+*/%^|!=&<>?;:]|\\|\[|\]" +color symbol.operator "[\-+*/%^|!=&<>?;:]|\\|\[|\]" color statement "\b(for|if|while|do|else|in|delete|exit)\b" color special "\b(break|continue|return)\b" color statement "\b(close|getline|next|nextfile|print|printf|system|fflush)\b" diff --git a/runtime/syntax/c++.micro b/runtime/syntax/c++.micro index 1ea8e2ca..c62a654a 100644 --- a/runtime/syntax/c++.micro +++ b/runtime/syntax/c++.micro @@ -7,7 +7,7 @@ color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b" color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b" color statement "\b(for|if|while|do|else|case|default|switch)\b" color statement "\b(try|throw|catch|operator|new|delete)\b" -color statement "\b(goto|continue|break|return)\b" +color special "\b(goto|continue|break|return)\b" color preproc "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)" color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" diff --git a/runtime/syntax/c.micro b/runtime/syntax/c.micro index f06e7bda..16080fa4 100644 --- a/runtime/syntax/c.micro +++ b/runtime/syntax/c.micro @@ -16,14 +16,15 @@ color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0 ## GCC builtins color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" +#Includes +color constant.string "<.+?>" + #Operator Color color symbol.operator "[.:;,+*|=!\%]" "<" ">" "/" "-" "&" #Parenthetical Color color symbol.brackets "[(){}]" "\[" "\]" -#Includes -color constant.string "<.+?>" #Integers color constant.number "\b[0-9]+\b" "\b0x[0-9A-Fa-f]+\b" color constant.number "NULL" diff --git a/runtime/syntax/clojure.micro b/runtime/syntax/clojure.micro new file mode 100644 index 00000000..de23b927 --- /dev/null +++ b/runtime/syntax/clojure.micro @@ -0,0 +1,29 @@ +#Syntax highlighting for Clojure +syntax "clojure" "\.(clj)$" + +#Constants +color constant "" +color constant.bool "\b(true|false)\b" +color constant.macro "\b(nil)\b" +#Valid numbers +color constant.number "[\-]?[0-9]+?\b" +color constant.number "0x[0-9][A-Fa-f]+?\b" +color constant.number "[\-]?(3[0-6]|2[0-9]|1[0-9]|[2-9])r[0-9A-Z]+?\b" +#Invalid numbers +color error "[\-]?([4-9][0-9]|3[7-9]|1|0)r[0-9A-Z]+?\b" + +#Symbols +color symbol.operator "[=>+\-*/'?]" + +#Types/casting +color type "\b(byte|short|(big)?int(eger)?|long|float|num|bigdec|rationalize)\b" + +#Bitwise operations +color special "" + +#String highlighting +color constant.string "" +color constant.specialChar "(\\u[0-9A-fa-f]{4,4}|\\newline|\\space|\\tab|\\formfeed|\\backspace|\\return|\\.)" + +#Comments +color comment ";.*$" diff --git a/runtime/syntax/coffeescript.micro b/runtime/syntax/coffeescript.micro index 2ed77571..0b9b2782 100644 --- a/runtime/syntax/coffeescript.micro +++ b/runtime/syntax/coffeescript.micro @@ -1,7 +1,7 @@ syntax "coffeescript" "\.coffee$" header "^#!.*/(env +)?coffee" -color symbol.operator "[!&|=/*+-<>]|\b(and|or|is|isnt|not)\b" +color symbol.operator "[!&|=/*+\-<>]|\b(and|or|is|isnt|not)\b" color identifier.class "[A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\()" "->" color symbol.brackets "[()]" color statement "\b(for|of|continue|break|isnt|null|unless|this|else|if|return)\b" @@ -14,3 +14,4 @@ color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" color comment "(^|[[:space:]])#([^{].*)?$" color indent-char.whitespace "[[:space:]]+$" color indent-char " + +| + +" +color preproc.shebang "#!.+$" diff --git a/runtime/syntax/crystal.micro b/runtime/syntax/crystal.micro index 1ee7aede..4ce4693f 100644 --- a/runtime/syntax/crystal.micro +++ b/runtime/syntax/crystal.micro @@ -26,7 +26,7 @@ color special "#\{[^}]*\}" color constant.string.char "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" ## Comments color comment "#[^{].*$" "#$" -color comment "##[^{].*$" "##$" +color comment.bright "##[^{].*$" "##$" ## "Here" docs color constant start="<<-?'?EOT'?" end="^EOT" ## Some common markers diff --git a/runtime/syntax/csharp.micro b/runtime/syntax/csharp.micro index 5a71c110..72fc258e 100644 --- a/runtime/syntax/csharp.micro +++ b/runtime/syntax/csharp.micro @@ -13,8 +13,8 @@ color statement "\b(abstract|async|class|const|delegate|enum|event|explicit|ext # LINQ-only keywords (ones that cannot be used outside of a LINQ query - lots others can) color statement "\b(from|where|select|group|info|orderby|join|let|in|on|equals|by|ascending|descending)\b" color special "\b(break|continue)\b" -color constant "\b(true|false)\b" -color symbol "[-+/*=<>?:!~%&|]" +color constant.bool "\b(true|false)\b" +color symbol.operator "[\-+/*=<>?:!~%&|]" color constant.number "\b([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\b" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" color constant.specialChar "\\([btnfr]|'|\"|\\)" diff --git a/runtime/syntax/css.micro b/runtime/syntax/css.micro index 2ba8a40b..f9229350 100644 --- a/runtime/syntax/css.micro +++ b/runtime/syntax/css.micro @@ -7,20 +7,23 @@ color symbol.brackets "\{|\}" # css commands color type "(align-content|align-items|alignment-baseline|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|appearance|azimuth|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|baseline-shift|bookmark-label|bookmark-level|bookmark-state|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-boundary|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-decoration-break|box-shadow|box-sizing|box-snap|box-suppress|break-after|break-before|break-inside|caption-side|caret|caret-animation|caret-color|caret-shape|chains|clear|clip|clip-path|clip-rule|color|color-interpolation-filters|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|columns|column-span|column-width|content|continue|counter-increment|counter-reset|counter-set|cue|cue-after|cue-before|cursor|direction|display|dominant-baseline|elevation|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|float-defer|float-offset|float-reference|flood-color|flood-opacity|flow|flow-from|flow-into|font|font-family|font-feature-settings|font-kerning|font-language-override|font-size|font-size-adjust|font-stretch|font-style|font-synthesis|font-variant|font-variant-alternates|font-variant-caps|font-variant-east-asian|font-variant-ligatures|font-variant-numeric|font-variant-position|font-weight|footnote-display|footnote-policy|glyph-orientation-vertical|grid|grid-area|grid-auto-columns|grid-auto-flow|grid-auto-rows|grid-column|grid-column-end|grid-column-gap|grid-column-start|grid-gap|grid-row|grid-row-end|grid-row-gap|grid-row-start|grid-template|grid-template-areas|grid-template-columns|grid-template-rows|hanging-punctuation|height|hyphenate-character|hyphenate-limit-chars|hyphenate-limit-last|hyphenate-limit-lines|hyphenate-limit-zone|hyphens|image-orientation|image-rendering|image-resolution|initial-letter|initial-letter-align|initial-letter-wrap|isolation|justify-content|justify-items|justify-self|left|letter-spacing|lighting-color|line-break|line-grid|line-height|line-snap|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|marker|marker-end|marker-knockout-left|marker-knockout-right|marker-mid|marker-pattern|marker-segment|marker-side|marker-start|marquee-direction|marquee-loop|marquee-speed|marquee-style|mask|mask-border|mask-border-mode|mask-border-outset|mask-border-repeat|mask-border-slice|mask-border-source|mask-border-width|mask-clip|mask-composite|mask-image|mask-mode|mask-origin|mask-position|mask-repeat|mask-size|mask-type|max-height|max-lines|max-width|min-height|min-width|mix-blend-mode|motion|motion-offset|motion-path|motion-rotation|nav-down|nav-left|nav-right|nav-up|object-fit|object-position|offset-after|offset-before|offset-end|offset-start|opacity|order|orphans|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-style|overflow-wrap|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page|page-break-after|page-break-before|page-break-inside|pause|pause-after|pause-before|perspective|perspective-origin|pitch|pitch-range|play-during|polar-anchor|polar-angle|polar-distance|polar-origin|position|presentation-level|quotes|region-fragment|resize|rest|rest-after|rest-before|richness|right|rotation|rotation-point|ruby-align|ruby-merge|ruby-position|running|scroll-behavior|scroll-snap-align|scroll-snap-margin|scroll-snap-margin-block|scroll-snap-margin-block-end|scroll-snap-margin-block-start|scroll-snap-margin-bottom|scroll-snap-margin-inline|scroll-snap-margin-inline-end|scroll-snap-margin-inline-start|scroll-snap-margin-left|scroll-snap-margin-right|scroll-snap-margin-top|scroll-snap-padding|scroll-snap-padding-block|scroll-snap-padding-block-end|scroll-snap-padding-block-start|scroll-snap-padding-bottom|scroll-snap-padding-inline|scroll-snap-padding-inline-end|scroll-snap-padding-inline-start|scroll-snap-padding-left|scroll-snap-padding-right|scroll-snap-padding-top|scroll-snap-type|shape-image-threshold|shape-inside|shape-margin|shape-outside|size|speak|speak-as|speak-header|speak-numeral|speak-punctuation|speech-rate|stress|string-set|stroke|stroke-alignment|stroke-dashadjust|stroke-dasharray|stroke-dashcorner|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|table-layout|tab-size|text-align|text-align-all|text-align-last|text-combine-upright|text-decoration|text-decoration-color|text-decoration-line|text-decoration-skip|text-decoration-style|text-emphasis|text-emphasis-color|text-emphasis-position|text-emphasis-style|text-indent|text-justify|text-orientation|text-overflow|text-shadow|text-space-collapse|text-space-trim|text-spacing|text-transform|text-underline-position|text-wrap|top|transform|transform-box|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch|voice-range|voice-rate|voice-stress|voice-volume|volume|white-space|widows|width|will-change|word-break|word-spacing|word-wrap|wrap-after|wrap-before|wrap-flow|wrap-inside|wrap-through|writing-mode|z-index):" -color normal start=":" end="[;^\{]" +color default start=":" end="[;^\{]" color special "!important" color identifier ":active|:focus|:hover|:link|:visited|:link|:after|:before|$" -color special "(\{|\}|\(|\)|\;|:|\]|~|<|>|,)" +color symbol "(\{|\}|\(|\)|\;|:|\]|~|<|>|,)" # SCSS Varaibles -color identifier (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?" +color identifier "(?i)\$\{?[0-9A-Z_!@#$*?-]+\}?" # SCSS Commands -color statement "@import|@mixin|@extend" +color preproc "@import|@mixin|@extend" + +# Hex color-codes +color constant.number "(?i)#[0-9A-F]{6,6}" # Strings -color constant ""(\\.|[^"])*"" -color constant "'(\\.|[^'])*'" +color constant.string ""(\\.|[^"])*"" +color constant.string "'(\\.|[^'])*'" color special """ color special "'" diff --git a/runtime/syntax/dot.micro b/runtime/syntax/dot.micro index 6ab7cbd9..2b8737de 100644 --- a/runtime/syntax/dot.micro +++ b/runtime/syntax/dot.micro @@ -1,7 +1,7 @@ syntax "dot" "\.(dot|gv)$" color type "\b(digraph|edge|graph|node|subgraph)\b" -color statement "\b(arrowhead|arrowsize|arrowtail|bgcolor|center|color|constraint|decorateP|dir|distortion|fillcolor|fontcolor|fontname|fontsize|headclip|headlabel|height|labelangle|labeldistance|labelfontcolor|labelfontname|labelfontsize|label|layers|layer|margin|mclimit|minlen|name|nodesep|nslimit|ordering|orientation|pagedir|page|peripheries|port_label_distance|rankdir|ranksep|rank|ratio|regular|rotate|samehead|sametail|shapefile|shape|sides|size|skew|style|tailclip|taillabel|URL|weight|width)\b" +color statement "\b(arrow(head|size|tail)|(bg|fill|font)?color|center|constraint|decorateP|dir|distortion|font(name|size)|head(clip|label)|height|label(angle|distance|font(color|name|size))?|layer(s)?|margin|mclimit|minlen|name|nodesep|nslimit|ordering|orientation|page(dir)?|peripheries|port_label_distance|rank(dir|sep)?|ratio|regular|rotate|same(head|tail)|shape(file)?|sides|size|skew|style|tail(clip|label)|URL|weight|width)\b" color symbol "=|->|--" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" color comment "(^|[[:space:]])//.*" diff --git a/runtime/syntax/erb.micro b/runtime/syntax/erb.micro index b04401b5..192aa025 100644 --- a/runtime/syntax/erb.micro +++ b/runtime/syntax/erb.micro @@ -3,10 +3,29 @@ ## Licensed under the CC (Creative Commons) License. ## ## https://github.com/geomic/ERB-And-More-Code-Highlighting-for-nano +#Note for dummies like me who had no idea what Embedded Ruby is: +# https://en.wikipedia.org/wiki/ERuby +# It's like Ruby for your browser. Heh. Cheers, CaptainMcClellan syntax "erb" "\.erb$" "\.rhtml$" -color symbol.brackets start="<" end=">" +#Highlights from html-land +color error "<[^!].*?>" +color symbol.tag "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" +color symbol.tag.extended "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>" +color preproc "(?i)<[/]?(script|style)( .*|>)*?>" +color special "&[^;[[:space:]]]*;" +color symbol "[:=]" +color identifier "(alt|bgcolor|height|href|id|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" +color constant.string ""[^"]*"" +color constant.number "(?i)#[0-9A-F]{6,6}" +color constant.string.url "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" +color comment "" +color preproc "" +## The tags that were here before. Disabled now. +#color symbol.tag start="<" end=">" +#Reset syntax highlighting for ruby color default start="<%" end="%>" +color preproc "<%|%>" color red "&[^;[[:space:]]]*;" color statement "\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b" color identifier.var "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*" @@ -22,4 +41,3 @@ color comment.bright "##[^{].*$" "##$" color identifier.macro start="<<-?'?EOT'?" end="^EOT" color todo "(XXX|TODO|FIXME|\?\?\?)" - diff --git a/runtime/syntax/fish.micro b/runtime/syntax/fish.micro index dc882cdf..7e1aa101 100644 --- a/runtime/syntax/fish.micro +++ b/runtime/syntax/fish.micro @@ -5,9 +5,10 @@ header "^#!.*/(env +)?fish( |$)" color constant.number "\b[0-9]+\b" # Conditionals and control flow -color statement "\b(and|begin|break|case|continue|else|end|for|function|if|in|not|or|return|select|shift|switch|while)\b" -color symbol "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|^|!|=|&|\|)" - +color statement "\b(and|begin|case|else|end|for|function|if|in|not|or|select|shift|switch|while)\b" +color special "\b(break|continue|return)\b" +color symbol "(\;|`|\\|\$|<|>|^|!|=|&|\|)" +color symbol.brackets "\{|\}|\(|\)|\[|\]" # Fish commands color type "\b(bg|bind|block|breakpoint|builtin|cd|count|command|commandline|complete|dirh|dirs|echo|emit|eval|exec|exit|fg|fish|fish_config|fish_ident|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|jobs|math|mimedb|nextd|open|popd|prevd|psub|pushd|pwd|random|read|set|set_color|source|status|string|trap|type|ulimit|umask|vared)\b" @@ -33,3 +34,6 @@ color identifier "\$\{?[0-9A-Za-z_!@#$*?-]+\}?" # Comments & TODOs color comment "(^|[[:space:]])#.*$" color todo "(TODO|XXX|FIXME):?" + +# Shebang +color preproc.shebang "^#!.+?( |$)" diff --git a/runtime/syntax/git-config.micro b/runtime/syntax/git-config.micro index 05549ed2..b797a476 100644 --- a/runtime/syntax/git-config.micro +++ b/runtime/syntax/git-config.micro @@ -1,6 +1,7 @@ syntax "git-config" "git(config|modules)$|\.git/config$" -color constant.bool "\b(true|false)\b" +color constant.bool.true "\btrue\b" +color constant.bool.false "\bfalse\b" color statement "^[[:space:]]*[^=]*=" color constant "^[[:space:]]*\[.*\]$" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/runtime/syntax/glsl.micro b/runtime/syntax/glsl.micro index 5d2c8abc..7b7f73c5 100644 --- a/runtime/syntax/glsl.micro +++ b/runtime/syntax/glsl.micro @@ -3,10 +3,10 @@ syntax "glsl" "\.(frag|vert|fp|vp|glsl)$" color identifier.class "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" color type "\b(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\b" color identifier "\bgl_(DepthRangeParameters|PointParameters|MaterialParameters|LightSourceParameters|LightModelParameters|LightModelProducts|LightProducts|FogParameters)\b" -color statement "\b(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\b" -color special "\b(break|continue)\b" +color statement "\b(const|attribute|varying|uniform|in|out|inout|if|else|discard|while|for|do)\b" +color special "\b(break|continue|return)\b" color constant.bool "\b(true|false)\b" -color symbol.operator "[-+/*=<>?:!~%&|^]" +color symbol.operator "[\-+/*=<>?:!~%&|^]" color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b" color comment "(^|[[:space:]])//.*" color comment start="/\*" end="\*/" diff --git a/runtime/syntax/go.micro b/runtime/syntax/go.micro index 8e74822e..1d2c11d1 100644 --- a/runtime/syntax/go.micro +++ b/runtime/syntax/go.micro @@ -14,7 +14,7 @@ color symbol "(,|\.)" color type "\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\b" color type "\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\b" ##I'm... not sure, but aren't structs a type? -color type "\b(struct)\b" +color type.keyword "\b(struct)\b" color constant.bool "\b(true|false|nil)\b" # Brackets diff --git a/runtime/syntax/golo.micro b/runtime/syntax/golo.micro index db546ee0..46e7e901 100644 --- a/runtime/syntax/golo.micro +++ b/runtime/syntax/golo.micro @@ -38,7 +38,7 @@ color constant "\b(and|in|is|not|or|isnt|orIfNull)\b" color constant.bool "\b(true|false)\b" color constant "\b(null|undefined)\b" -color symbol.brackets "[-+/*=<>!~%&|^]|:=" +color symbol.operator "[\-+/*=<>!~%&|^]|:=" color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b|'.'" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/runtime/syntax/html.micro b/runtime/syntax/html.micro index 251e59fa..a24e5942 100644 --- a/runtime/syntax/html.micro +++ b/runtime/syntax/html.micro @@ -1,14 +1,21 @@ -## Here is a short improved example for HTML. +## Here is a short improved example for generic HTML. ## syntax "html" "\.htm[l]?$" -color symbol "<|>" -color symbol.tag "<[^!].*?>" -color symbol "[:=]" + +color error "<[^!].*?>" +color symbol.tag "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" +color symbol.tag.extended "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" +color preproc "(?i)<[/]?(script|style)( .*)*?>" color special "&[^;[[:space:]]]*;" -color constant.string ""[^"]*"|qq\|.*\|" -color statement "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" -color constant.string.url "(ft(p|ps)|htt(p|ps)|git|chrome)://[^ ]+" +color symbol "[:=]" +color identifier "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)=" +color constant.string ""[^"]*"" +color constant.number "(?i)#[0-9A-F]{6,6}" +#Don't want or need tag highlighting outside of a tag! :) +color default start=">" end="<" +color symbol.tag "<|>" +color constant.string.url "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" color comment "" color preproc "" -# Bad possible work around for region-less regions. -#color default start=">" end="<" \ No newline at end of file + +# There's only so much we can do before regions and includes are implemented. :/ diff --git a/runtime/syntax/html4.micro b/runtime/syntax/html4.micro new file mode 100644 index 00000000..3695b2cd --- /dev/null +++ b/runtime/syntax/html4.micro @@ -0,0 +1,21 @@ +## Here is a short improved example for HTML. +## +## HTML 4 strict. (No html5 or depreciated html) +syntax "html4" "\.htm[l]?$" +header "" + +color error "<[^!].*?>" +color symbol.tag "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" +color symbol.tag.extended "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" +color preproc "(?i)<[/]?(script|style)( .*)*?>" +color special "&[^;[[:space:]]]*;" +color symbol "[:=]" +color identifier "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)=" +color constant.string ""[^"]*"" +color constant.number "(?i)#[0-9A-F]{6,6}" +#Don't want or need tag highlighting outside of a tag! :) +color default start=">" end="<" +color symbol.tag "<|>" +color constant.string.url "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" +color comment "" +color preproc "" diff --git a/runtime/syntax/html5.micro b/runtime/syntax/html5.micro new file mode 100644 index 00000000..4b904e79 --- /dev/null +++ b/runtime/syntax/html5.micro @@ -0,0 +1,23 @@ +## Here is a short improved example for HTML. +## +syntax "html5" "\.htm[l]?$" +header "" + +#Lint an invalid tag. +color error "<[^!].*?>" +color 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)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u|ul|var|video|wbr)( .*)*?>" +color symbol.tag.extended "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" +color preproc "(?i)<[/]?(script|style)( .*)*?>" +color special "&[^;[[:space:]]]*;" +color symbol "[:=]" +color identifier "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)=" +color constant.string ""[^"]*"" +color constant.number "(?i)#[0-9A-F]{6,6}" +#Don't want or need tag highlighting outside of a tag! :) +color default start=">" end="<" +color symbol.tag "<|>" +color constant.string.url "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" +color comment "" +color preproc "" + +# There's only so much we can do before regions and includes are implemented. :/ diff --git a/runtime/syntax/ini.micro b/runtime/syntax/ini.micro index edc26251..277edb4e 100644 --- a/runtime/syntax/ini.micro +++ b/runtime/syntax/ini.micro @@ -1,7 +1,8 @@ syntax "ini" "\.(ini|desktop|lfl|override)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$" header "^\[[A-Za-z]+\]$" -color constant "\b(true|false)\b" +color constant.bool.true "\btrue\b" +color constant.bool.false "\bfalse\b" color identifier "^[[:space:]]*[^=]*=" color special "^[[:space:]]*\[.*\]$" color statement "[=;]" diff --git a/runtime/syntax/java.micro b/runtime/syntax/java.micro index 91c86033..c146327e 100644 --- a/runtime/syntax/java.micro +++ b/runtime/syntax/java.micro @@ -3,7 +3,7 @@ syntax "java" "\.java$" color type "\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\b" color statement "\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\b" -color type "\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\b" +color type.keyword "\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\b" color constant.string ""[^"]*"" color constant.bool "\b(true|false|null)\b" color constant.number "\b[0-9]+\b" diff --git a/runtime/syntax/javascript.micro b/runtime/syntax/javascript.micro index 9462be0b..789d0937 100644 --- a/runtime/syntax/javascript.micro +++ b/runtime/syntax/javascript.micro @@ -1,8 +1,8 @@ syntax "javascript" "\.js$" -color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" -color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" -color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" +color constant.number "\b[\-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" +color constant.number "\b[\-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+\-]?[0-9]+)?[fFlL]?" +color constant.number "\b[\-+]?([0-9]+[EePp][+\-]?[0-9]+)[fFlL]?" color identifier "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" color statement "\b(break|case|catch|continue|default|delete|do|else|finally)\b" color statement "\b(for|function|get|if|in|instanceof|new|return|set|switch)\b" @@ -11,7 +11,7 @@ color constant.bool "\b(null|undefined|NaN)\b" color constant.bool "\b(true|false)\b" color type "\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\b" color type "\b(Number|Object|RegExp|String)\b" -color symbol.operator "[-+/*=<>!~%?:&|]" +color symbol.operator "[\-+/*=<>!~%?:&|]" color constant "/[^*]([^/]|(\\/))*[^\\]/[gim]*" color constant "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]" color comment "(^|[[:space:]])//.*" diff --git a/runtime/syntax/json.micro b/runtime/syntax/json.micro index a59cbf79..a170561e 100644 --- a/runtime/syntax/json.micro +++ b/runtime/syntax/json.micro @@ -1,9 +1,9 @@ syntax "json" "\.json$" header "^\{$" -color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" -color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" -color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" +color constant.number "\b[\-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" +color constant.number "\b[\-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+\-]?[0-9]+)?[fFlL]?" +color constant.number "\b[\-+]?([0-9]+[EePp][+\-]?[0-9]+)[fFlL]?" color constant.bool "\b(null)\b" color constant.bool.true "\b(true)\b" color constant.bool.false "\b(false)\b" diff --git a/runtime/syntax/keymap.micro b/runtime/syntax/keymap.micro index d06de9d8..38129d47 100644 --- a/runtime/syntax/keymap.micro +++ b/runtime/syntax/keymap.micro @@ -1,7 +1,7 @@ syntax "keymap" "\.(k|key)?map$|Xmodmap$" color statement "\b(add|clear|compose|keycode|keymaps|keysym|remove|string)\b" -color statement "\b(control|alt|shift)\b" +color identifier "\b(control|alt|shift)\b" color constant.number "\b[0-9]+\b" color symbol "=" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/runtime/syntax/ledger.micro b/runtime/syntax/ledger.micro index 5021ba66..e53cfa1d 100644 --- a/runtime/syntax/ledger.micro +++ b/runtime/syntax/ledger.micro @@ -5,6 +5,6 @@ color constant "^[0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}" color statement "^~ .*" color identifier.var "^= .*" color identifier "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z ]+(:[A-Za-z ]+)*\)?" -color identifier "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z_-]+(:[A-Za-z_-]+)*\)?" +color identifier "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z_\-]+(:[A-Za-z_\-]+)*\)?" color symbol "[*!]" color comment "^[[:space:]]*;.*" diff --git a/runtime/syntax/lfe.micro b/runtime/syntax/lfe.micro index caa44b9c..f5089184 100644 --- a/runtime/syntax/lfe.micro +++ b/runtime/syntax/lfe.micro @@ -1,19 +1,18 @@ syntax "lfe" "lfe$" "\.lfe$" # Parens are everywhere! -color statement "\(" -color statement "\)" +color symbol.brackets "\(|\)" # Good overrides for LFE in particular color type "defun|define-syntax|define|defmacro|defmodule|export" # Dirty base cases stolen from the generic lisp syntax color constant "\ [A-Za-z][A-Za-z0-9_-]+\ " -color symbol.operator "\(([-+*/<>]|<=|>=)|'" +color symbol.operator "\(([\-+*/<>]|<=|>=)|'" color constant.number "\b[0-9]+\b" color constant.string "\"(\\.|[^"])*\"" -color special "['|`][A-Za-z][A-Za-z0-9_-]+" -color constant.string "\\.?" +color special "['|`][A-Za-z][A-Za-z0-9_\-]+" +color constant.specialChar "\\.?" color comment "(^|[[:space:]]);.*" # Some warning colors because our indents are wrong. diff --git a/runtime/syntax/lilypond.micro b/runtime/syntax/lilypond.micro index 40c73fb6..8c11a018 100644 --- a/runtime/syntax/lilypond.micro +++ b/runtime/syntax/lilypond.micro @@ -2,7 +2,7 @@ syntax "lilypond" "\.ly$" "\.ily$" "\.lly$" color constant.number "\d+" color identifier "[[:space:]](staff|spacing|signature|routine|notes|handler|corrected|beams|arpeggios|Volta_engraver|Voice|Vertical_align_engraver|Vaticana_ligature_engraver|VaticanaVoice|VaticanaStaff|Tweak_engraver|Tuplet_engraver|Trill_spanner_engraver|Timing_translator|Time_signature_performer|Time_signature_engraver|Tie_performer|Tie_engraver|Text_spanner_engraver|Text_engraver|Tempo_performer|Tab_tie_follow_engraver|Tab_staff_symbol_engraver|Tab_note_heads_engraver|TabVoice|TabStaff|System_start_delimiter_engraver|Stem_engraver|Stanza_number_engraver|Stanza_number_align_engraver|Staff_symbol_engraver|Staff_performer|Staff_collecting_engraver|StaffGroup|Staff|Spanner_break_forbid_engraver|Span_bar_stub_engraver|Span_bar_engraver|Span_arpeggio_engraver|Spacing_engraver|Slur_performer|Slur_engraver|Slash_repeat_engraver|Separating_line_group_engraver|Script_row_engraver|Script_engraver|Script_column_engraver|Score|Rhythmic_column_engraver|RhythmicStaff|Rest_engraver|Rest_collision_engraver|Repeat_tie_engraver|Repeat_acknowledge_engraver|Pure_from_neighbor_engraver|Pitched_trill_engraver|Pitch_squash_engraver|Piano_pedal_performer|Piano_pedal_engraver|Piano_pedal_align_engraver|PianoStaff|Phrasing_slur_engraver|PetrucciVoice|PetrucciStaff|Percent_repeat_engraver|Part_combine_engraver|Parenthesis_engraver|Paper_column_engraver|Output_property_engraver|Ottava_spanner_engraver|OneStaff|NullVoice|Note_spacing_engraver|Note_performer|Note_name_engraver|Note_heads_engraver|Note_head_line_engraver|NoteName\|NoteHead|New_fingering_engraver|Multi_measure_rest_engraver|Midi_control_function_performer|Metronome_mark_engraver|Mensural_ligature_engraver|MensuralVoice|MensuralStaff|Mark_engraver|Lyrics|Lyric_performer|Lyric_engraver|Ligature_bracket_engraver|Ledger_line_engraver|Laissez_vibrer_engraver|Kievan_ligature_engraver|KievanVoice|KievanStaff|Key_performer|Key_engraver|Keep_alive_together_engraver|Instrument_switch_engraver|Instrument_name_engraver|Hyphen_engraver|Grob_pq_engraver|GregorianTranscriptionVoice|GregorianTranscriptionStaff|GrandStaff|Grace_spacing_engraver|Grace_engraver|Grace_beam_engraver|Grace_auto_beam_engraver|Global|Glissando_engraver|Fretboard_engraver|FretBoards|Forbid_line_break_engraver|Footnote_engraver|Font_size_engraver|Fingering_engraver|Fingering_column_engraver|Figured_bass_position_engraver|Figured_bass_engraver|FiguredBass|Extender_engraver|Episema_engraver|Dynamics|Dynamic_performer|Dynamic_engraver|Dynamic_align_engraver|Drum_notes_engraver|Drum_note_performer|DrumVoice|DrumStaff|Double_percent_repeat_engraver|Dots_engraver|Dot_column_engraver|Devnull|Default_bar_line_engraver|Custos_engraver|Cue_clef_engraver|CueVoice|Control_track_performer|Concurrent_hairpin_engraver|Collision_engraver|Cluster_spanner_engraver|Clef_engraver|Chord_tremolo_engraver|Chord_name_engraver|ChordNames|ChoirStaff|Breathing_sign_engraver|Break_align_engraver|Bend_engraver|Beam_performer|Beam_engraver|Beam_collision_engraver|Bar_number_engraver|Bar_engraver|Axis_group_engraver|Auto_beam_engraver|Arpeggio_engraver|Accidental_engraver|Score)[[:space:]]" -color statement "[-_^]?\\[-A-Za-z_]+" +color statement "[\-_^]?\\[\-A-Za-z_]+" color preproc "\b(((gisis|gis|geses|ges|g|fisis|fis|feses|fes|f|eisis|eis|eeses|ees|e|disis|dis|deses|des|d|cisis|cis|ceses|ces|c|bisis|bis|beses|bes|b|aisis|ais|aeses|aes|a)[,']*[?!]?)|s|r|R|q)(128|64|32|16|8|4|2|1|\\breve|\\longa|\\maxima)?([^\\\w]|_|\b)" color symbol.brackets "[(){}<>]" "\[" "\]" color constant.string "\".*\"" diff --git a/runtime/syntax/lisp.micro b/runtime/syntax/lisp.micro index 6f91e46a..4f7653c9 100644 --- a/runtime/syntax/lisp.micro +++ b/runtime/syntax/lisp.micro @@ -1,10 +1,10 @@ syntax "lisp" "(emacs|zile)$" "\.(el|li?sp|scm|ss)$" color default "\([a-z-]+" -color symbol "\(([-+*/<>]|<=|>=)|'" +color symbol "\(([\-+*/<>]|<=|>=)|'" color constant.number "\b[0-9]+b>" color special "\bnil\b" -color brightcyan "\b[tT]b>" +color preproc "\b[tT]b>" color constant.string "\"(\\.|[^"])*\"" color constant.specialChar "'[A-Za-z][A-Za-z0-9_-]+" color constant.specialChar "\\.?" diff --git a/runtime/syntax/lua.micro b/runtime/syntax/lua.micro index 2e112cfa..cd8dd98a 100644 --- a/runtime/syntax/lua.micro +++ b/runtime/syntax/lua.micro @@ -43,7 +43,7 @@ color identifier "\:\b(close|flush|lines|read|seek|setvbuf|write)\b" color constant.bool "\b(false|nil|true)\b" # External files -color statement "(\b(dofile|require|include)|%q|%!|%Q|%r|%x)\b" +color preproc "(\b(dofile|require|include)|%q|%!|%Q|%r|%x)\b" # Numbers color constant.number "\b([0-9]+)\b" @@ -60,9 +60,6 @@ color constant start="\s*\[\[" end="\]\]" # Escapes color special "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]|\\[abefnrs]|(\\c|\\C-|\\M-|\\M-\\C-)." -# Shebang -color comment "^#!.*" - # Simple brightblacks color comment "\-\-.*$" diff --git a/runtime/syntax/markdown.micro b/runtime/syntax/markdown.micro index 03cfd0e5..0ba27506 100644 --- a/runtime/syntax/markdown.micro +++ b/runtime/syntax/markdown.micro @@ -22,7 +22,7 @@ color symbol "^(---+|\+---+|===+|\+===+|___+|\*\*\*+|\+\*\*\*+)\s*$" color statement "^#{1,6}.*" # lists -color identifier "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. " +color identifier "^[[:space:]]*[\*+\-] |^[[:space:]]*[0-9]+\. " # misc color preproc "\b([CcRr]|[Tt][Mm])\b" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])" @@ -38,7 +38,7 @@ color underlined "!\[[^][]*\](\([^)]+\)|\[[^]]+\])" color underlined.url "https?://[^ )>]+" # code -color special "`.*?`|^ {4}[^-+*].*" +color special "`.*?`|^ {4}[^\-+*].*" # code blocks color symbol "^```$" diff --git a/runtime/syntax/micro.micro b/runtime/syntax/micro.micro index c52e0020..4611f892 100644 --- a/runtime/syntax/micro.micro +++ b/runtime/syntax/micro.micro @@ -2,12 +2,18 @@ syntax "micro" "\.(micro)$" color statement "\b(syntax|color(-link)?)\b" -color statement "\b(start=|end=)\b" -color identifier "\b(default|comment|symbol|identifier|constant(.string(.char)?|.specialChar|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column|tabbar)\b" +color type.keyword "\b(start=|end=)\b" +color identifier "\b(default|comment|symbol(.brackets|.tag)?|identifier|constant(.string(.char)?|.bool|.specialChar|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column|tabbar)\b" +color preproc "\b(syntax|header)\b" color constant.number "\b(|h|A|0x)+[0-9]+(|h|A)+\b" color constant.number "\b0x[0-9 a-f A-F]+\b" color comment "#.*$" +#For better reverse compatibility with nanorc converted files. +color comment.bright "##.*$" color constant.string ""(\\.|[^"])*"" color constant.number "#[0-9 A-F a-f]{1,6}" + +#Fixed highlighting the first few digits of a full line comment as hex. +color comment "^#.*$" diff --git a/runtime/syntax/nginx.micro b/runtime/syntax/nginx.micro index 3f0c4419..476efb11 100644 --- a/runtime/syntax/nginx.micro +++ b/runtime/syntax/nginx.micro @@ -3,7 +3,8 @@ header "^(server|upstream)[a-z ]*\{$" color preproc "\b(events|server|http|location|upstream)[[:space:]]*\{" color statement "(^|[[:space:]{;])(access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth_basic|auth_basic_user_file|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|default_type|deny|directio|directio_alignment|disable_symlinks|empty_gif|env|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|log_format|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|port_in_redirect|postpone_output|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_header|proxy_read_timeout|proxy_redirect|proxy_send_timeout|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|working_directory|xml_entities|xslt_stylesheet|xslt_types)([[:space:]]|$)" -color constant.bool "\b(on|off)\b" +color constant.bool.true "\b(on)\b" +color constant.bool.false "\b(off)\b" color identifier "\$[A-Za-z][A-Za-z0-9_]*" color symbol "[*]" color constant-string ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/runtime/syntax/objc.micro b/runtime/syntax/objc.micro index cce5daec..373d6494 100644 --- a/runtime/syntax/objc.micro +++ b/runtime/syntax/objc.micro @@ -12,7 +12,7 @@ color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b" color statement "\b(for|if|while|do|else|case|default|switch)\b" color statement "\b(try|throw|catch|operator|new|delete)\b" -color statement "\b(goto|continue|break|return)\b" +color special "\b(goto|continue|break|return)\b" color statement "\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\b" color statement "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)" @@ -26,7 +26,8 @@ color symbol.operator "[.:;,+*|=!\%\[\]]" "<" ">" "/" "-" "&" color constant.number "\b(-?)?[0-9]+\b" "\b\[0-9]+\.[0-9]+\b" "\b0x[0-9A-F]+\b" color constant "@\[(\\.|[^\]])*\]" "@\{(\\.|[^\}])*\}" "@\((\\.|[^\)])*\)" color constant "\b<(\\.[^\b])*\b\b" -color constant "\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\b" +color constant.bool "\b(nil|NULL|YES|NO|TRUE|true|FALSE|false)\b" +color special "\b(self)\b" color constant "\bk[[:alnum]]*\b" color constant.string "\"(\\.|[^\"])*\"" "@\"(\\.|[^\"])*\"" "'.'" diff --git a/runtime/syntax/ocaml.micro b/runtime/syntax/ocaml.micro index fecfefc6..5b742290 100644 --- a/runtime/syntax/ocaml.micro +++ b/runtime/syntax/ocaml.micro @@ -14,7 +14,7 @@ color constant.number "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*" ### Decimal color constant.number "-?\d[\d_]*.\d[\d_]*([eE][+-]\d[\d_]*.\d[\d_]*)?" ### Hexadecimal -color constant.number "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?" +color constant.number "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+\-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?" # Comments color comment start="\(\*" end="\*\)" diff --git a/runtime/syntax/pascal.micro b/runtime/syntax/pascal.micro index 3e372937..f4c7f825 100644 --- a/runtime/syntax/pascal.micro +++ b/runtime/syntax/pascal.micro @@ -12,7 +12,7 @@ color constant "\b(?i:(false|true|nil))\b" color special start="asm" end="end" -color constant.number "\$[0-9A-Fa-f]+" "\b[+-]?[0-9]+([.]?[0-9]+)?(?i:e[+-]?[0-9]+)?" +color constant.number "\$[0-9A-Fa-f]+" "\b[+\-]?[0-9]+([.]?[0-9]+)?(?i:e[+\-]?[0-9]+)?" color constant.string "#[0-9]{1,}" color constant.string "'(?:[^']+|'')*'" @@ -20,4 +20,4 @@ color preproc start="{\$" end="}" color comment "//.*" color comment start="\(\*" end="\*\)" -color comment start="({)(?:[^$])" end="}" \ No newline at end of file +color comment start="({)(?:[^$])" end="}" diff --git a/runtime/syntax/perl.micro b/runtime/syntax/perl.micro index 584d59f2..0df5358a 100644 --- a/runtime/syntax/perl.micro +++ b/runtime/syntax/perl.micro @@ -6,7 +6,7 @@ header "^#!.*/(env +)?perl( |$)" color type "\b(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\b" "\b(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\b" "\b(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\b" "\b(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\b" "\b(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\b" color statement "\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\b" #TODO: This regex needs to be fixed. -color identifier (i) start="[$@%]" end="( |[^0-9A-Z_]|-)" +color identifier start="[$@%]" end="((?i) |[^0-9A-Z_]|-)" #ENDTODO. color constant.string "".*"|qq\|.*\|" color default "[sm]/.*/" diff --git a/runtime/syntax/php.micro b/runtime/syntax/php.micro index ee63c1f4..8dcfe60e 100644 --- a/runtime/syntax/php.micro +++ b/runtime/syntax/php.micro @@ -1,36 +1,66 @@ #This file probably needs cleanup!! syntax "php" "\.php[2345s~]?$" -color symbol.brackets "<.+?>" -color preproc "<\?(php|=)?" -color preproc "\?>" -#color preproc start="<\?(php|=)?" end="\?>" +#Broken! Don't enable! +#color default start="<.+?>" end="<.+?>" +color symbol.operator "<|>" +color error "<[^!].*?>" +color symbol.tag "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" +color symbol.tag.extended "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>" +color preproc "(?i)<[/]?(script|style)( .*|>)*?>" +#Highlighting from html land +color special "&[^;[[:space:]]]*;" +color symbol "[:=]" +color identifier "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" +color constant.string ""[^"]*"" +color constant.number "(?i)#[0-9A-F]{6,6}" +#Don't want or need tag highlighting outside of a tag! :) +#color default start=">" end="<" +color constant.string.url "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" +color comment "" + + +#Reset highlighting to begin php +color default "<\?(php|=)" end="\?>" color identifier.class "([a-zA-Z0-9_-]+)\(" -color type "(var|class|goto|extends|function|echo|case|break|default|exit|switch|foreach|endforeach|while|const|static|extends|as|require|include|require_once|include_once|define|do|continue|declare|goto|print|in|trait|interface|[E|e]xception|array|int|string|bool|iterable|void)[\s|\)]" +color preproc "(require|include|require_once|include_once)" + +color type "\b(var|class|extends|function|echo|case|default|exit|switch|extends|as|define|do|declare|in|trait|interface|[E|e]xception|array|int|string|bool|iterable|void)\b" color identifier.class "[a-zA-Z\\]+::" -color identifier "new\s([a-zA-Z0-9\\]+)" color identifier "([A-Z][a-zA-Z0-9_]+)\s" color identifier "([A-Z0-9_]+)[;|\s|\)|,]" -color statement "(implements|abstract|global|public|instanceof|private|protected|static|if|else|elseif|endif|namespace|use|as|new|throw|catch|try|return)[\s|;]" +color type.keyword "(global|public|private|protected|static|const)" +color statement "(implements|abstract|instanceof|if|else(if)?|endif|namespace|use|as|new|throw|catch|try|while|print|(end)?(foreach)?)\b" +color identifier "new\s([a-zA-Z0-9\\]+)" +color special "(break|continue|goto|return)" color constant.bool "(true|false|null|TRUE|FALSE|NULL)" -color constant "[\s|=|>|\s|\(|/|+|-|\*|\[](\d+)" +color constant "[\s|=|\s|\(|/|+|-|\*|\[]" +color constant.number "[0-9]" color identifier "(\$this|parent|self|\$this->)" color symbol.operator "(=>|===|!==|==|!=|&&|\|\||::|=|->|\!)" color identifier.var "(\$[a-zA-Z0-9\-_]+)" -color symbol.operator "[\(|\)|/|+|-|\*|\[|,|;]" +color symbol.operator "[\(|\)|/|+|\-|\*|\[|.|,|;]" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" color constant.specialChar "\\[abfnrtv'\"\\]" +color symbol.brackets "(\[|\]|\{|\}|[()])" + color comment "(^|[[:space:]])//.*" color comment "(^|[[:space:]])#.*" color comment start="/\*" end="\*/" + +color preproc "<\?(php|=)?" +color preproc "\?>" +color preproc "" + + diff --git a/runtime/syntax/pony.micro b/runtime/syntax/pony.micro index 9397f9ef..9db1d659 100644 --- a/runtime/syntax/pony.micro +++ b/runtime/syntax/pony.micro @@ -20,7 +20,7 @@ color statement "\b(is|isnt|not|and|or|xor)\b" color type "\b(_*[A-Z][_a-zA-Z0-9\']*)\b" color constant "\b(this)\b" -color constant "\b(true|false)\b" +color constant.bool "\b(true|false)\b" color constant.number "\b((0b[0-1_]*)|(0o[0-7_]*)|(0x[0-9a-fA-F_]*)|([0-9_]+(\.[0-9_]+)?((e|E)(\\+|-)?[0-9_]+)?))\b" color constant.string ""(\\.|[^"])*"" diff --git a/runtime/syntax/puppet.micro b/runtime/syntax/puppet.micro index f0a5daf0..c1140ab8 100644 --- a/runtime/syntax/puppet.micro +++ b/runtime/syntax/puppet.micro @@ -30,7 +30,7 @@ color special "\$\{[^}]*\}" color constant.string "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" ## Comments color comment "#[^{].*$" "#$" -color comment "##[^{].*$" "##$" +color comment.bright "##[^{].*$" "##$" ## Some common markers color todo "(XXX|TODO|FIXME|\?\?\?)" ## Trailing spaces diff --git a/runtime/syntax/python2.micro b/runtime/syntax/python2.micro index ab494612..744ce6ba 100644 --- a/runtime/syntax/python2.micro +++ b/runtime/syntax/python2.micro @@ -21,7 +21,9 @@ color type "\b(basestring|bool|buffer|bytearray|bytes|classmethod|complex|dict|e ## definitions color identifier "def [a-zA-Z_0-9]+" ## keywords -color statement "\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\b" +color preproc "\b(import)\b" +color statement "\b(and|as|assert|class|def|del|elif|else|except|finally|for|from|global|if|in|is|lambda|not|or|pass|print|raise|try|while|with|yield)\b" +color special "\b(break|continue|return)\b" ## decorators color special "@.*[(]" @@ -44,3 +46,6 @@ color comment "#.*$" ## block brightblacks color comment start=""""([^"]|$)" end=""""" color comment start="'''([^']|$)" end="'''" + +## Shebang +color preproc.shebang "^#!.+?( |$)" diff --git a/runtime/syntax/python3.micro b/runtime/syntax/python3.micro index f9eb9242..009c265e 100644 --- a/runtime/syntax/python3.micro +++ b/runtime/syntax/python3.micro @@ -21,16 +21,18 @@ color type "\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|fl ## definitions color identifier "def [a-zA-Z_0-9]+" ## keywords -color statement "\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b" +color preproc "\b(import)\b" +color statement "\b(and|as|assert|class|def|del|elif|else|except|finally|for|from|global|if|in|is|lambda|nonlocal|not|or|pass|raise|try|while|with|yield)\b" +color special "\b(break|continue|return)\b" ## decorators color special "@.*[(]" ## operators -color statement "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&" +color symbol.operator "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&" ## parentheses -color statement "[(){}]" "\[" "\]" +color symbol.brackets "[(){}]" "\[" "\]" ## numbers color constant.number "\b[0-9]+\b" @@ -44,3 +46,6 @@ color comment "#.*$" ## block brightblacks color comment start=""""([^"]|$)" end=""""" color comment start="'''([^']|$)" end="'''" + +## Shebang +color preproc.shebang "^#!.+?( |$)" diff --git a/runtime/syntax/reST.micro b/runtime/syntax/reST.micro index 4f6489fd..626ace78 100644 --- a/runtime/syntax/reST.micro +++ b/runtime/syntax/reST.micro @@ -1,27 +1,42 @@ ## For reST syntax "rst" "\.rest$" "\.rst$" + +# Lists, bulleted and enumerated +color identifier "^[\*+\-] " +color identifier "^[0-9]+?\. " # italics -#color magenta "\*[^*]\*" +color type "\*[^*]+?\*" # bold -color red "\*\*[^*]+\*\*" +color type.keyword "\*\*[^\*]+\*\*" # code block -color brightred "::" +color symbol "::" # link reference -color blue "`[^`]+`_{1,2}" +color underlined.url "`[^`]+`_{1,2}" # code -color yellow "``[^`]+``" +color special "``[^`]+``" # directives or comments -color cyan "^\.\. .*$" +color comment "^\.\. .*$" # anon link targets -color cyan "^__ .*$" +color underlined "^__ .*$" # h1 -color yellow "^###+$" -color yellow "^\*\*\*+$" +color statement "^###+$" +color statement "^\*\*\*+$" # h2 -color magenta "^===+$" +color preproc "^===+$" # h3 -color red "^---+$" +color identifier "^---+$" # h4 -color green "^\^\^\^+$" +color type.keyword "^\^\^\^+$" # h5 -color blue "^"""+$" +color constant "^"""+$" + +# urls +color underlined.url "http(s)?://[^ )>]+" + +#Tables +color preproc "\+[\-=+]+\+" +color preproc "\|" + +# I went and looked up an reStructured Text Specification. +# I really hope I got the right one. I tried to align +# color choices with the ones for markdown and asciidoc diff --git a/runtime/syntax/ruby.micro b/runtime/syntax/ruby.micro index 15135694..fee2918a 100644 --- a/runtime/syntax/ruby.micro +++ b/runtime/syntax/ruby.micro @@ -26,9 +26,11 @@ color special "#\{[^}]*\}" color constant.string "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" ## Comments color comment "#[^{].*$" "#$" -color comment "##[^{].*$" "##$" +color comment.bright "##[^{].*$" "##$" ## "Here" docs color constant.macro start="<<-?'?EOT'?" end="^EOT" ## Some common markers color todo "(XXX|TODO|FIXME|\?\?\?)" +## Color the shebang +color preproc.shebang "^#!.+?( |$)" diff --git a/runtime/syntax/scala.micro b/runtime/syntax/scala.micro index 16cd678b..ab83e281 100644 --- a/runtime/syntax/scala.micro +++ b/runtime/syntax/scala.micro @@ -5,7 +5,7 @@ color type "\b(boolean|byte|char|double|float|int|long|new|short|this|transient| color statement "\b(match|val|var|break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\b" color statement "\b(def|object|case|trait|lazy|implicit|abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile|sealed)\b" color constant.string ""[^"]*"" -color constant "\b(true|false|null)\b" +color constant.bool "\b(true|false|null)\b" color comment "//.*" color comment start="/\*" end="\*/" color comment.bright start="/\*\*" end="\*/" diff --git a/runtime/syntax/sh.micro b/runtime/syntax/sh.micro index ed4215e8..2f7bcf31 100644 --- a/runtime/syntax/sh.micro +++ b/runtime/syntax/sh.micro @@ -34,3 +34,6 @@ color identifier.var "\$\{?[0-9A-Za-z_!@#$*?-]+\}?" # Comments & TODOs color comment "(^|[[:space:]])#.*$" color todo "(TODO|XXX|FIXME):?" + +# Shebang +color preproc.shebang "^#!.+?( |$)" diff --git a/runtime/syntax/sls.micro b/runtime/syntax/sls.micro index a39ddf26..7d11010e 100644 --- a/runtime/syntax/sls.micro +++ b/runtime/syntax/sls.micro @@ -11,7 +11,7 @@ color default "salt:" # Numbers, etc color constant.number "/*[0-9]/*" -color constant "\b(True|False)\b" +color constant.bool "\b(True|False)\b" # Anything between two single quotes color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/runtime/syntax/sql.micro b/runtime/syntax/sql.micro index 5880c56f..3f8eca08 100644 --- a/runtime/syntax/sql.micro +++ b/runtime/syntax/sql.micro @@ -1,29 +1,29 @@ syntax "sql" "\.sql$" "sqliterc$" -color statement (i) "\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\b" -color statement (i) "\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\b" -color statement (i) "\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\b" -color statement (i) "\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\b" -color statement (i) "\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\b" -color statement (i) "\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\b" -color statement (i) "\b(GROUP|GRANT|HAVING)\b" -color statement (i) "\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\b" -color statement (i) "\b(JOIN|KEYS|KILL|KEY)\b" -color statement (i) "\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\b" -color statement (i) "\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\b" -color statement (i) "\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\b" -color statement (i) "\b(PROCEDURE|PROCEDURAL|PRIMARY)\b" -color statement (i) "\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\b" -color statement (i) "\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\b" -color statement (i) "\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\b" -color statement (i) "\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\b" -color statement (i) "\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b" -color type "\b(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b" +color statement "(?i)\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\b" +color statement "(?i)\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\b" +color statement "(?i)\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\b" +color statement "(?i)\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\b" +color statement "(?i)\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\b" +color statement "(?i)\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\b" +color statement "(?i)\b(GROUP|GRANT|HAVING)\b" +color statement "(?i)\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\b" +color statement "(?i)\b(JOIN|KEYS|KILL|KEY)\b" +color statement "(?i)\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\b" +color statement "(?i)\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\b" +color statement "(?i)\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\b" +color statement "(?i)\b(PROCEDURE|PROCEDURAL|PRIMARY)\b" +color statement "(?i)\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\b" +color statement "(?i)\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\b" +color statement "(?i)\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\b" +color statement "(?i)\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\b" +color statement "(?i)\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b" +color type "(?i)\b(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b" # SQLite meta commands -color preproc (i) "\.\b(databases|dump|echo|exit|explain|header(s)?|help)\b" -color preproc (i) "\.\b(import|indices|mode|nullvalue|output|prompt|quit|read)\b" -color preproc (i) "\.\b(schema|separator|show|tables|timeout|width)\b" +color preproc "(?i)\.\b(databases|dump|echo|exit|explain|header(s)?|help)\b" +color preproc "(?i)\.\b(import|indices|mode|nullvalue|output|prompt|quit|read)\b" +color preproc "(?i)\.\b(schema|separator|show|tables|timeout|width)\b" color constant.bool "\b(ON|OFF)\b" color constant.number "\b([0-9]+)\b" diff --git a/runtime/syntax/swift.micro b/runtime/syntax/swift.micro index aabf24a7..d6e0d647 100644 --- a/runtime/syntax/swift.micro +++ b/runtime/syntax/swift.micro @@ -12,8 +12,8 @@ color statement "(class|import|let|var|struct|enum|func|if|else|switch|case|def color statement "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\ " # Keywords -color statement "(print)" -color statement "(init)" +color preproc "(print)" +color preproc "(init)" # Numbers color constant.number "([0-9]+)" diff --git a/runtime/syntax/typescript.micro b/runtime/syntax/typescript.micro index 8f6ba15b..51d6aea4 100644 --- a/runtime/syntax/typescript.micro +++ b/runtime/syntax/typescript.micro @@ -1,8 +1,8 @@ syntax "typescript" "\.ts$" -color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" -color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" -color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" +color constant.number "\b[\-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b" +color constant.number "\b[\-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+\-]?[0-9]+)?[fFlL]?" +color constant.number "\b[\-+]?([0-9]+[EePp][+\-]?[0-9]+)[fFlL]?" color identifier.class "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" color statement "\b(abstract|as|async|await|break|case|catch|class|const|constructor|continue)\b" color statement "\b(debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from)\b" @@ -13,7 +13,7 @@ color constant.bool "\b(false|true|null|undefined|NaN)\b" color type "\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\b" color type "\b(Number|Object|RegExp|String|Symbol)\b" color type "\b(any|boolean|never|number|string|symbol)\b" -color symbol.operator "[-+/*=<>!~%?:&|]" +color symbol.operator "[\-+/*=<>!~%?:&|]" color constant "/[^*]([^/]|(\\/))*[^\\]/[gim]*" color constant "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]" color comment "(^|[[:space:]])//.*" diff --git a/runtime/syntax/vala.micro b/runtime/syntax/vala.micro index 35e90d38..5c579360 100644 --- a/runtime/syntax/vala.micro +++ b/runtime/syntax/vala.micro @@ -9,7 +9,7 @@ color statement "\b(class|override|private|public|signal|this|weak)\b" color special "\b(goto|break|continue)\b" color constant.bool "\b(true|false)\b" color constant.number "\b([0-9]+)\b" -color symbol.operator "[-+/*=<>?:!~%&|]" "->" +color symbol.operator "[\-+/*=<>?:!~%&|]" "->" color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" color comment "(^|[[:space:]])//.*" color comment start="/\*" end="\*/" diff --git a/runtime/syntax/vhdl.micro b/runtime/syntax/vhdl.micro index e51ae99c..2978461c 100644 --- a/runtime/syntax/vhdl.micro +++ b/runtime/syntax/vhdl.micro @@ -40,7 +40,7 @@ color symbol.operator "(\+|-|\*|/|&|<|>|=|\.|:)" ## constants color constant.number "(?i)'([0-1]|u|x|z|w|l|h|-)'" "[box]?"([0-1a-fA-F]|u|x|z|w|l|h|-)+"" -color constant.number "(?i)\b[0-9\._]+(e[-]?[0-9]+)?( ?[fpnum]?s)?\b" +color constant.number "(?i)\b[0-9\._]+(e[\-]?[0-9]+)?( ?[fpnum]?s)?\b" color constant.bool "(?i)\b(true|false)\b" ## severity levels color constant "(?i)\b(note|warning|error|failure)\b" diff --git a/runtime/syntax/zsh.micro b/runtime/syntax/zsh.micro index b70b3ac2..77cd67e6 100644 --- a/runtime/syntax/zsh.micro +++ b/runtime/syntax/zsh.micro @@ -40,3 +40,6 @@ color comment.bright "(^|[[:space:]])##.*$" ## Trailing spaces color indent-char.whitespace "[[:space:]]+$" + +##Shebang +color preproc.shebang "^#!.+?( |$)"