syntax: gentoo: various updates

- make version highlight less blindly greedy and conform to real versions
- move version matching before USE matching to avoid hitting USE flags
  that look like versions
- change USE regex to match the Gentoo PMS
- extend arch match to include more keywords
- make category matching more restrictive to avoid false positives
- drop operators =< and => that Gentoo doesn't support

URL: https://savannah.gnu.org/bugs/?49569
Reported-by: Konstantin Shakhnov <kastian@mail.ru>
master
Mike Frysinger 2016-11-14 13:44:53 -05:00
parent e332d2df74
commit e472b72565
1 changed files with 7 additions and 7 deletions

View File

@ -49,19 +49,19 @@ color ,green "[[:space:]]+$"
syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$" syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
## Base text: ## Base text:
color green "^.+$" color green "^.+$"
## Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
## Likely version and slot numbers: ## Likely version and slot numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)" color magenta "-[[:digit:].]+(_(alpha|beta|pre|rc|p)[[:digit:]]*)*(-r[[:digit:]]+)?([:[:space:]]|$)"
color magenta ":[^[:space:]]+([[:space:]]|$)" color magenta ":[^[:space:]]+([[:space:]]|$)"
## Use flags (must come after version/slot):
color brightred "[[:space:]]+\+?[A-Za-z0-9+_@-]+"
color brightblue "[[:space:]]+-[A-Za-z0-9+_@-]+"
## Accepted arches: ## Accepted arches:
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc(-fbsd)?|x86(-fbsd)?)\>" color white "[~-]?\<(alpha|amd64|arm(64)?|hppa|ia64|m68k|mips|nios2|ppc(64)?|riscv|s390|sh|sparc|x86)(-(aix|(f|free|net|open)bsd|cygwin|hpux|interix|linux|macos|mint|solaris|winnt))?\>"
color white "[[:space:]][*~-]?\*" color white "[[:space:]][*~-]?\*"
## Categories: ## Categories:
color cyan "^[[:space:]]*.*/" color cyan "^[[:space:]]*[^/]*/"
## Masking regulators: ## Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)" color brightmagenta "^[[:space:]]*(=|~|<|<=|>|>=)"
## Comments: ## Comments:
color yellow "#.*$" color yellow "#.*$"
## Trailing space is bad! ## Trailing space is bad!