syntax: gentoo: remove some obsolete keywords and add some new ones

Removals:
  - All eblits were dropped from Gentoo years ago.
  - HDEPEND was never fully approved, superseded by BDEPEND.
  - Keywords 'dohard' and 'dosed' have been banned since EAPI 4:
    https://projects.gentoo.org/pms/5/pms.html#x1-130001r8
  - Several arches are dead.  For the currently supported list:
    https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/arch.list

Additions:
  - Two eapply functions replace the epatch functions, but epatch
    is still supported until EAPI 6 is banned.
  - Modern build systems (ninja and qmake5) have new functions.
  - EAPI 7 added more builtins: dostrip, get_libdir, ver_*
  - Highlight the cross-compiler boolean function.  (There are too
    many toolchain functions to add them all, but this one is very
    common and has a long name, so highlighting it is useful for
    catching typos early.)

The EAPI documentation:
    https://projects.gentoo.org/pms/8/pms.html#x1-590007

An extensive write-up on EAPI 7:
    https://mgorny.pl/articles/the-ultimate-guide-to-eapi-7.html

Signed-off-by: David Michael <fedora.dm0@gmail.com>
master
David Michael 2021-06-21 11:15:06 -04:00 committed by Benno Schulenberg
parent ac85e16458
commit 7b4a835df4
1 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
## Syntax highlighting for Gentoo ebuilds/eclasses, ## Syntax highlighting for Gentoo ebuilds/eclasses,
## and (further down) for Portage control files. ## and (further down) for Portage control files.
syntax ebuild "\.e(build|class|blit)$" syntax ebuild "\.e(build|class)$"
comment "#" comment "#"
## All the standard portage functions: ## All the standard portage functions:
@ -17,7 +17,7 @@ color green "-(eq|ne|gt|lt|ge|le)\>"
## Variables... official portage ones in red, all others in bright red: ## Variables... official portage ones in red, all others in bright red:
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:digit:]]|@)+\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:digit:]]|@)+\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|[BHIPR]?DEPEND|PROVIDE|PROPERTIES|REQUIRED_USE|RESTRICT|USERLAND)\>" color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|[BIPR]?DEPEND|PROVIDE|PROPERTIES|REQUIRED_USE|RESTRICT|USERLAND)\>"
color red "\<(S|E?D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|EPREFIX|(B|E|E?SYS)?ROOT|WORKDIR)\>" color red "\<(S|E?D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|EPREFIX|(B|E|E?SYS)?ROOT|WORKDIR)\>"
color red "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>" "\<(MERGE_TYPE|REPLACING_VERSIONS|REPLACED_BY_VERSION)\>" color red "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>" "\<(MERGE_TYPE|REPLACING_VERSIONS|REPLACED_BY_VERSION)\>"
color red "\<EBUILD_PHASE(_FUNC)?\>" color red "\<EBUILD_PHASE(_FUNC)?\>"
@ -25,17 +25,17 @@ color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPP
color red "\<(PATCHES|(HTML_)?DOCS)\>" "\<WANT_(AUTO(CONF|MAKE)|LIBTOOL)\>" "\<AT_M4DIR\>" color red "\<(PATCHES|(HTML_)?DOCS)\>" "\<WANT_(AUTO(CONF|MAKE)|LIBTOOL)\>" "\<AT_M4DIR\>"
## Portage commands: ## Portage commands:
color magenta "\<(use(_(with|enable|if_iuse)|x)?|in_iuse) [!a-zA-Z0-9_+ -]*" "inherit.*" color magenta "\<(use(_(with|enable|if_iuse)|x)?|in_iuse) [!a-zA-Z0-9_+ -]*" "inherit.*"
color brightblue "\<e(begin|end|conf|install|make|qmake4|ant|(qa)?warn|infon?|error|log|patch(_user)?|new(group|user))\>" color brightblue "\<e(apply(_user)?|begin|end|conf|install|make|ninja|qmake5|ant|(qa)?warn|infon?|error|log|patch(_user)?|new(group|user))\>"
color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make)|libtoolize)\>" color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make)|libtoolize)\>"
color brightblue "\<e(stack|shopts|umask)_(push|pop)\>" "\<version_is_at_least\>" color brightblue "\<e(stack|shopts|umask)_(push|pop)\>" "\<get_libdir\>" "\<ver_(cut|rs|test)\>" "\<version_is_at_least\>"
color brightblue "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>" color brightblue "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
color brightblue "\<(die|hasv?|inherit|nonfatal)\>" "\<(use(_(with|enable|if_iuse)|x)?|in_iuse)\>" "\<(has|best)_version\>" color brightblue "\<(die|hasv?|inherit|nonfatal)\>" "\<(use(_(with|enable|if_iuse)|x)?|in_iuse)\>" "\<(has|best)_version\>"
color brightblue "\<(do|new)(ins|(games)?s?bin|doc|lib(\.so|\.a)?|man|info|exe|initd|confd|envd|pam|menu|icon)\>" color brightblue "\<(do|new)(ins|s?bin|doc|header|lib(\.so|\.a)?|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
color brightblue "\<do(compress|header|python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>" color brightblue "\<do(compress|dir|html|mo|strip|sym)\>" "\<keepdir\>"
color brightblue "\<prepall(docs|info|man|strip)?\>" "\<prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)\>" color brightblue "\<prepall(docs|info|man|strip)?\>" "\<prep(info|lib|lib\.(so|a)|man|strip)\>"
color brightblue "\<(doc|ins|exe)?into\>" "\<(f|games)(owners|perms)\>" "\<(exe|ins|dir)opts\>" color brightblue "\<(doc|ins|exe)?into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
color brightblue "\<tc-get(BUILD_)?(AR|AS|CC|CPP|CXX|LD|NM|OBJCOPY|PKG_CONFIG|RANLIB)\>" color brightblue "\<tc-get(BUILD_)?(AR|AS|CC|CPP|CXX|LD|NM|OBJCOPY|PKG_CONFIG|RANLIB)\>"
color brightblue "\<tc-(arch(-kernel)?|export|has-(tls|openmp))\>" color brightblue "\<tc-(arch(-kernel)?|export|has-(tls|openmp)|is-cross-compiler)\>"
## Common commands used in ebuilds: ## Common commands used in ebuilds:
color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|unset|xargs)\>" color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|unset|xargs)\>"
## Comments (doesn't work that well): ## Comments (doesn't work that well):
@ -60,7 +60,7 @@ color magenta ":[^[:space:]]+([[:space:]]|$)"
color brightred "[[:space:]]+\+?[A-Za-z0-9+_@-]+" color brightred "[[:space:]]+\+?[A-Za-z0-9+_@-]+"
color brightblue "[[:space:]]+-[A-Za-z0-9+_@-]+" color brightblue "[[:space:]]+-[A-Za-z0-9+_@-]+"
## Accepted arches: ## Accepted arches:
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 "[~-]?\<(alpha|amd64|arm(64)?|hppa|ia64|m68k|mips|ppc(64)?|riscv|s390|sparc|x86)(-(cygwin|linux|macos|solaris|winnt))?\>"
color white "[[:space:]][*~-]?\*" color white "[[:space:]][*~-]?\*"
## Categories: ## Categories:
color cyan "^[[:space:]]*[^/]*/" color cyan "^[[:space:]]*[^/]*/"