micro/runtime/syntax/gentoo.micro

51 lines
2.5 KiB
Text
Raw Normal View History

2016-03-21 19:16:02 +03:00
## Here is an example for ebuilds/eclasses
##
syntax "Ebuild" "\.e(build|class)$"
## All the standard portage functions
color brightgreen "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
## Highlight bash related syntax
color green "\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\b"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "-(e|d|f|r|g|u|w|x|L)\b"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\b"
## Highlight variables ... official portage ones in red, all others in bright red
color brightred "\$\{?[a-zA-Z_0-9]+\}?"
color red "\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\b"
color red "\b(S|D|T|PV|PF|P|PN|A)\b" "\bC(XX)?FLAGS\b" "\bLDFLAGS\b" "\bC(HOST|TARGET|BUILD)\b"
## Highlight portage commands
color magenta "\buse(_(with|enable))?\b [!a-zA-Z0-9_+ -]*" "inherit.*"
color brightblue "\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\b"
color brightblue "\bdie\b" "\buse(_(with|enable))?\b" "\binherit\b" "\bhas\b" "\b(has|best)_version\b" "\bunpack\b"
color brightblue "\b(do|new)(ins|s?bin|doc|lib(\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\b"
color brightblue "\bdo(python|sed|dir|hard|sym|html|jar|mo)\b" "\bkeepdir\b"
color brightblue "prepall(docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
color brightblue "\b(doc|ins|exe)into\b" "\bf(owners|perms)\b" "\b(exe|ins|dir)opts\b"
## Highlight common commands used in ebuilds
color blue "\bmake\b" "\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\b"
## Highlight brightblacks (doesnt work that well)
2016-03-21 19:16:02 +03:00
color yellow "#.*$"
## Highlight strings (doesnt work that well)
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## Trailing space is bad!
color ,green "[[:space:]]+$"
## Here is an example for Portage control files
##
syntax "etc-portage" "\.(keywords|mask|unmask|use)$"
## Base text:
color green "^.+$"
## Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
## Likely version numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)"
## Accepted arches:
color white "[~-]?\b(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\b"
color white "[[:space:]][~-]?\*"
## Categories:
color cyan "^[[:space:]]*.*/"
## Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
## Comments:
color yellow "#.*$"