micro/runtime/syntax/gentoo-ebuild.micro
2016-08-31 12:12:23 -04:00

29 lines
1.9 KiB
Text

## Here is an example for ebuilds/eclasses
##
syntax "ebuild" "\.e(build|class)$"
## All the standard portage functions
color identifier "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
## Highlight bash related syntax
color statement "\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 statement "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color statement "-(e|d|f|r|g|u|w|x|L)\b"
color statement "-(eq|ne|gt|lt|ge|le|s|n|z)\b"
## Highlight variables ... official portage ones in red, all others in bright red
color preproc "\$\{?[a-zA-Z_0-9]+\}?"
color special "\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\b"
color special "\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 identifier "\buse(_(with|enable))?\b [!a-zA-Z0-9_+ -]*" "inherit.*"
color statement "\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\b"
color statement "\bdie\b" "\buse(_(with|enable))?\b" "\binherit\b" "\bhas\b" "\b(has|best)_version\b" "\bunpack\b"
color statement "\b(do|new)(ins|s?bin|doc|lib(\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\b"
color statement "\bdo(python|sed|dir|hard|sym|html|jar|mo)\b" "\bkeepdir\b"
color statement "prepall(docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
color statement "\b(doc|ins|exe)into\b" "\bf(owners|perms)\b" "\b(exe|ins|dir)opts\b"
## Highlight common commands used in ebuilds
color type "\bmake\b" "\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\b"
## Highlight comments (doesnt work that well)
color comment "#.*$"
## Highlight strings (doesnt work that well)
color constant.string ""(\\.|[^\"])*"" "'(\\.|[^'])*'"