syntax: spec: colorize the date and author of changelog items differently

Also, remove superfluous parentheses, add missing edge-of-word markers,
correct the "ppciseries" keyword, and fold some regexes (or elements of
them) together.
master
Benno Schulenberg 2020-02-23 19:46:54 +01:00
parent e873121372
commit 6c6a3f6bd3
1 changed files with 17 additions and 20 deletions

View File

@ -4,20 +4,17 @@ syntax spec "\.spec(\.[^/]+)?$"
comment "#" comment "#"
# Main tags. # Main tags.
color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)" color brightblue "\<(BuildArch(itectures)?|Exclusive(Arch|OS)|Exclude(Arch|OS))[[:space:]]*:"
color brightblue "((BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[[:space:]]*:)" color brightblue "\<(Conflicts|Enhances|Obsoletes|Provides|Requires(\(.*\))?|Recommends|Suggests|Supplements|BuildConflicts|BuildRequires|PreReq)[[:space:]]*:"
color brightblue "((Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements)[[:space:]]*:)" color brightblue "\<(Epoch|Icon|Nosource|Nopatch|Serial)[[:space:]]*:"
color brightblue "((Epoch|Serial|Nosource|Nopatch)[[:space:]]*:)" color brightblue "\<(AutoReq|AutoProv|AutoReqProv)[[:space:]]*:"
color brightblue "((AutoReq|AutoProv|AutoReqProv)[[:space:]]*:)" color brightblue "\<(Copyright|License|Summary(\(.*\))?|Distribution|Vendor|Packager|Group|BuildRoot|Prefix)[[:space:]]*:"
color brightblue "((Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|BuildRoot|Prefix)[[:space:]]*:)" color brightblue "\<(Name|Version|Release|URL|Url)[[:space:]]*:"
color brightblue "((Name|Version|Release|Url|URL)[[:space:]]*:)"
color brightblue "\<(Source|Patch)[0-9]*[[:space:]]*:" color brightblue "\<(Source|Patch)[0-9]*[[:space:]]*:"
# Architectures. # Architectures.
color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)" color brightred "\<(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppciseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x?|noarch)\>"
# Architecture conditionals. # Architecture and OS conditionals.
color brightred "%(ifarch|ifnarch|elifarch)" color brightred "%(ifarch|elifarch|ifnarch|ifos|elifos|ifnos)\>"
# OS conditionals.
color brightred "%(ifos|ifnos|elifos)"
# %* strings. # %* strings.
color green "%([A-Z_a-z_0-9_]*)" color green "%([A-Z_a-z_0-9_]*)"
color magenta "%_([A-Z_a-z_0-9_]*)" color magenta "%_([A-Z_a-z_0-9_]*)"
@ -25,19 +22,19 @@ color yellow start="%__" end="\ "
color magenta start="%\{" end="\}" color magenta start="%\{" end="\}"
color yellow start="%\{__" end="\}" color yellow start="%\{__" end="\}"
# Sections. # Sections.
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|pretrans|preun)" color red "^%(build$|changelog|check$|clean$|description|files|install$|package|prep$)"
color red "^%(post|posttrans|postun|trigger|triggerprein|triggerin|triggerun|triggerpostun|verifyscript)" color red "^%((pre|post)(trans|un)?|trigger(prein|in|un|postun)?|verifyscript)"
color red "^%(filetriggerin|filetriggerpostun|filetriggerun|transfiletriggerin|transfiletriggerpostun|transfiletriggerun)" color red "^%(trans)?filetrigger(in|un|postun)?"
color red "^%(sourcelist|patchlist|generate_buildrequires)" color red "^%(sourcelist|patchlist|generate_buildrequires)"
# Conditionals and defines. # Conditionals and defines.
color brightred "%(if|elif|else|endif|define|global|undefine)" color brightred "%(if|elif|else|endif|define|global|undefine)\>"
# Comments. # Comments.
color cyan "#.*" color cyan "(#|%dnl[[:space:]]).*"
color cyan "%dnl[[:space:]].*"
# Special case: "# norootforbuild" is handled as main tag. # Special case: "# norootforbuild" is handled as main tag.
color brightblue "^# norootforbuild" color brightblue "^# norootforbuild"
# Date-plus-author headers of %changelog entries. # First the author, then just the date of %changelog entries.
color brightyellow "^\* .+>" color yellow "^\* .+>"
color brightyellow "^\* [[:alnum:] ]+ [0-9]{4} "
# Trailing whitespace. # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"