Add colorscheme support for gentoo-ebuild

See #229
This commit is contained in:
Zachary Yedidia 2016-08-31 12:12:23 -04:00
parent 1be332a0f9
commit 031ed64305
2 changed files with 19 additions and 21 deletions

View file

@ -1057,7 +1057,7 @@ func runtimeSyntaxGdscriptMicro() (*asset, error) {
return a, nil
}
var _runtimeSyntaxGentooEbuildMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\x55\x5f\x73\xd3\xb8\x17\x7d\xef\xa7\x10\x6e\xe7\x87\x5c\x48\x7e\xbc\xc2\xb2\x64\xb2\x49\xa0\x19\xb2\x4d\x26\x49\x81\xdd\x3a\x64\x15\xfb\xda\xd6\x46\x96\xbc\x92\xdc\xb4\x70\xf8\xee\x3b\x4a\x1c\x86\x52\x98\x7d\x68\x63\xe9\x5e\x9f\x7b\xee\xb9\x7f\x7c\x7a\xca\x2e\xc8\x12\x93\x8e\x09\xcd\xe8\x56\x54\xb5\x22\x96\x1b\xcb\x68\xd3\x48\x95\xb9\xff\x53\xaa\x84\x73\xe4\x4e\x4e\x4f\x4f\xdc\x9d\xf6\xe2\x96\x45\x07\x5b\xc4\xa2\xa4\x4b\x7c\xff\x8c\xbd\x57\x7c\x16\x9d\x9c\x9e\xb2\xbe\x52\xcc\x97\xc4\x9c\x17\x3a\x13\x36\x63\xb5\xb1\x5e\x14\xc4\xf2\x46\xa7\x5e\x1a\xed\x4e\x52\xa3\x8c\x65\x1b\x2b\x8b\xd2\x17\x96\x48\xb3\xe8\xa3\xb3\xe9\x9a\x37\xba\x16\xe9\x16\xa9\xa9\x6a\xa9\x08\x52\x3b\x2f\x94\x82\x27\xe7\xe3\x88\x45\x1f\xeb\x6d\xb1\xe6\xa9\xd1\xb9\x2c\xa0\x4d\x4e\x3e\x2d\xe1\xc8\x37\x35\x78\x6d\x09\xb5\x71\x3e\xe6\xe1\x2d\xd8\x2a\x8e\xf7\x74\x2e\x64\x51\xaa\x10\x88\x6d\x84\x2b\x99\x25\x25\x3c\x65\xec\x90\x4c\xcb\xa4\xe5\x90\xbc\xe4\xa9\x70\x84\xcc\x20\x33\x9a\x40\x4a\xe6\x20\xe5\x08\xe4\x44\x0a\xba\x95\x1e\xb9\x44\x6e\x2c\x8e\xb9\x40\xe6\x90\x1a\xca\xa4\x42\xc1\x92\xc8\x60\xc9\x37\x56\xc3\x91\xa2\xd4\xc3\x95\x32\xf7\xf0\x25\x69\x78\x59\x11\x1a\xed\xa5\xc2\xae\x0c\xd9\xa5\x46\x7b\xa9\x1b\xc2\xc6\x92\xd8\xc6\xc9\xab\xe8\x3e\x1d\x9e\x7c\x46\xf2\x05\x09\x47\x12\x23\xf9\x05\xc9\x0a\xc9\x35\xfe\x42\x92\x20\x39\xc3\x4b\xbc\xc2\x23\xfc\x8a\xff\x21\x41\xfc\xdd\x9b\x1d\x4e\xc8\x90\xc3\xa2\x40\x83\x1d\x6e\x31\x79\x08\xdf\xe1\xf4\x0f\x34\xa1\xf0\x50\x1e\x05\x41\x11\x1c\x34\x3e\xed\x5d\xef\x29\x77\x23\xac\x14\x1b\x45\x8e\x75\xbb\x5d\x66\xf2\x5c\xa6\x52\xa8\xaf\x85\x35\x9a\x1c\x93\x9a\x59\xca\x9e\x32\xa1\x14\x33\xbe\x24\xbb\xbf\x3a\xd4\x38\x58\xee\x15\xdd\x52\xc6\xa2\xe4\x2c\xf9\xdc\xbb\x16\x9d\x4f\xfd\xce\x9f\xeb\x67\x9d\xe7\xab\x27\xc9\x97\xde\x91\xe4\xc1\xe3\x25\xef\xcf\x07\x17\xb8\x98\xfe\x3e\x9a\xf5\xdf\x8c\x30\x1c\x2d\x06\xf3\xf1\x6c\x39\x9e\x5e\x62\x7c\xb5\x18\x61\x31\x1f\xac\xaf\xe6\x63\x4c\xc6\x83\xd1\x65\x38\x4f\xa6\x4b\xbc\x1d\xfd\xf1\x7e\x3a\x1f\x2e\xf0\x7a\x3c\x19\x2d\x86\xe3\x39\xde\x4f\xe7\x6f\xc3\x2f\x9f\x61\x1e\xf7\x86\xa3\xd9\xe8\x72\x88\xd9\x7c\xfa\x6e\x3c\x1c\x61\x38\x5e\x2c\x83\x71\x3e\x5a\x2c\xe7\xe3\xc1\x12\x57\x8b\xd1\x7c\xd2\xbf\x1c\x7e\xa3\xd9\x91\xce\x02\x43\x2c\x31\x7b\x87\xd9\x6b\xcc\x30\xbb\x44\x3f\x38\x05\xd3\x80\x7f\xf8\x10\xf7\x5e\x4f\xfa\x6f\x16\xed\xcd\x64\xf8\xed\x69\xc0\x2f\xa6\x8b\x25\x96\xfd\xf9\x9b\xd1\x12\xbf\x5d\x8d\x27\xc3\x87\x42\x1f\x15\x4d\x4d\x55\x09\x9d\x1d\x27\xa5\x12\x05\x69\x2f\x02\x4c\xe3\x88\xaf\xf9\x4e\xfa\x12\xa4\x43\x4d\xe2\xb8\x97\xbc\x62\xd7\x8f\x0e\x3a\x3e\xeb\x3c\x5f\x3f\x61\x9d\xd5\x79\xc4\x22\xa9\x4b\xb2\xd2\x77\xcf\xa3\x7b\xda\x6f\x54\x43\x01\x89\xf8\x86\x0a\xa9\x41\x3a\x0b\xad\x98\x7f\x9d\xb6\x4a\x6c\x09\x3b\x61\x35\xa4\xce\x8d\xee\x81\xac\x35\x16\xca\x14\xa8\x45\x98\x38\x4d\x3b\x5e\x58\xd3\xd4\x68\x1c\xd9\xf8\x1b\x99\xee\x47\xc8\x24\xb5\xc9\xff\x98\xf5\xde\xd4\xb2\x6c\x4f\xa5\x70\xed\x13\x2f\x85\xc3\x26\x0c\xfe\xfa\x86\xac\x93\x46\x1f\xb1\xf6\x3b\xe2\x67\x31\x79\x66\x02\xbf\xfd\x16\x80\xeb\x6d\xa4\x46\x66\x52\x28\xb9\xe1\x49\xd7\x19\x24\x5d\x11\xa3\x12\x87\xdc\x40\xb7\x61\xc9\x48\x7f\x50\x20\x03\xe9\x9b\x0c\xb5\xa8\x50\x91\x6e\x20\x53\xa3\x7f\x9e\x9c\xe1\xf5\x9d\x2f\x4d\x18\xf5\x0c\x99\xb4\x28\x85\xcd\xe0\xee\x2a\x94\xbe\x52\xf8\x5b\x58\x54\xe6\xd8\x1d\x5b\xa2\x3a\x93\xf6\xc7\x60\xb5\xa5\x5a\x28\xc5\x33\x93\xba\x03\xaf\x40\xd0\x79\x2b\xeb\xb0\xf5\x82\x99\xef\xaf\x95\xdc\x84\xbf\xa4\xcb\x9d\x41\x9b\x47\xeb\xf6\x33\x31\xd2\x50\xd6\x90\x67\x2c\xb5\x37\x2d\x9b\x9c\x9b\x9d\x26\xeb\x50\x93\xad\xdc\x91\x23\x3f\xa8\xe1\x42\x32\xb1\xa9\xbd\x7b\xd0\x9e\xa1\x2d\x8d\xfe\xda\x9d\xac\x71\x94\x85\x29\x6f\xbf\x16\x47\x0e\x6d\xf4\xd0\x47\x47\xe8\x54\x78\xa4\x19\xd2\xb2\x32\xe1\xbf\xd9\x69\xa4\x35\x28\x2d\x4d\xd0\x1c\x74\x1b\x3a\x1f\x85\xa5\x1a\x8a\x3c\x94\x46\xb5\x0d\x9a\x56\x37\xb0\xd5\x5e\x61\x47\x1e\x5e\x58\x78\xd3\xa4\x25\x1a\xed\xc8\x3f\x9c\x9f\xc0\x8c\xb4\x77\x8c\x67\x86\x9c\xf6\x6c\x67\xec\x96\xf9\x52\x78\xb6\x23\xa5\xe2\x96\xe1\x1d\x29\x65\x76\x2c\x3a\xed\x9e\x9f\x7d\x87\x10\xe4\xd4\xc5\x7f\x01\x1c\x64\x3e\xc2\x44\x3c\x49\xba\xb8\xfe\x98\x44\xab\xf8\x3c\x8a\x58\xf4\xb8\xbd\x78\xbc\x8a\xcf\x1f\xef\x03\x2c\xad\x90\x4a\xea\x82\xb9\x5a\xa4\xfb\x0f\xee\x46\x64\x8f\x5a\xb4\xa7\xed\x46\xbe\xbe\x7e\xb1\x37\xbf\x58\xad\x9e\x9c\x45\x27\xff\x06\x00\x00\xff\xff\xed\xbf\x25\xc4\x9e\x07\x00\x00")
var _runtimeSyntaxGentooEbuildMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\x55\x5d\x73\xdb\x36\x10\x7c\xf7\xaf\x40\x68\x4f\x03\x3a\xb5\x9a\xd7\x4c\x3f\x3c\xaa\xa4\xc4\x9a\xa8\x96\x46\x92\x93\xb4\x86\xa3\x82\xe4\x51\x44\x05\x02\x2c\x00\x5a\x76\xb2\xf9\xef\x1d\x48\xb4\x27\xad\x95\xe9\x83\x24\x02\x77\x3c\xec\x2e\xf6\x4e\xc7\xc7\xec\x82\x1c\x31\xe5\x99\x34\x8c\xee\x64\xdd\x68\x62\xa5\x75\x8c\xb2\x56\xe9\xc2\xff\x40\xb9\x96\xde\x93\x3f\x3a\x3e\x3e\xf2\xf7\x26\xc8\x3b\x96\xec\x63\x09\x4b\x44\x8f\xf8\xee\x19\xbb\xac\xf4\x24\x39\x3a\x3e\x66\x7d\xad\x59\xa8\x88\xf9\x20\x4d\x21\x5d\xc1\x1a\xeb\x82\x5c\x13\x2b\x5b\x93\x07\x65\x8d\x3f\xca\xad\xb6\x8e\xa9\x82\x4c\x50\xa5\x22\xc7\x92\x8f\xde\xe5\x2b\xde\x9a\x46\xe6\x1b\xe4\xb6\x6e\x94\x26\x28\xe3\x83\xd4\x1a\x81\x7c\x48\x13\x96\x7c\x6c\x36\xeb\x15\xcf\xad\x29\xd5\x1a\xc6\x96\x14\xf2\x0a\x9e\x42\xdb\x80\x37\x8e\xd0\x58\x1f\x52\x1e\xdf\x82\xab\xd3\x74\x87\xe6\x42\xad\x2b\xad\xd6\x55\x60\x99\xf4\x15\x73\xa4\x65\xa0\x82\xed\xb9\x74\x40\x7c\x90\x81\x6a\x32\x81\x25\x22\xe3\xb9\xf4\x84\xc2\xa2\xb0\x86\x40\x5a\x95\x20\xed\x09\xe4\x65\x0e\xba\x53\x01\xa5\x42\x69\x1d\x1e\xe8\x40\x95\x50\x06\xda\xe6\x52\xc3\x91\x2c\xe0\x28\xb4\xce\xc0\x93\xa6\x3c\xc0\x57\xaa\x0c\x08\x15\x19\x04\x55\x13\x5a\x13\x94\xc6\xb6\x8a\x0c\x73\x6b\x82\x32\x2d\x21\x73\x24\x37\xa9\xc8\x92\xa7\x90\xb8\xf8\x0c\xf1\x05\x82\x43\xa4\x10\x3f\x42\xdc\x40\x5c\xe3\x4f\x08\x01\x71\x82\x9f\xf0\x0b\x9e\xe1\x67\x7c\x07\x81\xf4\xc0\xdb\x67\x9c\x50\xa0\x84\xc3\x1a\x2d\xb6\xb8\xc3\xe4\xf0\x31\x67\x9c\xfe\x86\x21\xac\x03\x74\xc0\x9a\xa0\x09\x1e\x06\x9f\x76\xe9\xff\x52\xf2\x56\x3a\x25\x33\x4d\x9e\xf5\x7a\x3d\x66\xcb\x52\xe5\x4a\xea\xc7\x7b\xb6\x86\x3c\x53\x86\x39\x2a\xbe\x67\x52\x6b\x66\x43\x45\x6e\xb7\x95\xb9\x5d\x01\x47\x45\x07\xa0\x71\xd4\x38\x9b\xb3\x44\x9c\x88\xcf\xe7\xd7\xf2\xec\x53\xff\xec\x8f\xd5\xcb\xb3\x57\x37\x2f\xc4\x97\xf3\x47\x98\x0d\xed\x4e\x88\xd7\xd3\x9f\x0f\x2e\x70\x31\xfd\x6d\x34\xeb\xbf\x19\x61\x38\x5a\x0c\xe6\xe3\xd9\x72\x3c\xbd\xc4\xf8\x6a\x31\xc2\x62\x3e\x58\x5d\xcd\xc7\x98\x8c\x07\xa3\xcb\xb8\x9e\x4c\x97\x78\x3b\xfa\xfd\xfd\x74\x3e\x5c\xe0\xf5\x78\x32\x5a\x0c\xc7\x73\xbc\x9f\xce\xdf\xc6\x5f\x3e\xc3\x3c\x3d\x1f\x8e\x66\xa3\xcb\x21\x66\xf3\xe9\xbb\xf1\x70\x84\xe1\x78\xb1\x8c\xc1\xf9\x68\xb1\x9c\x8f\x07\x4b\x5c\x2d\x46\xf3\x49\xff\x72\xf8\xb5\x72\x5f\x41\x5a\x60\x88\x25\x66\xef\x30\x7b\x8d\x19\x66\x97\xe8\xc7\xc4\x18\x1a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e3\x8d\x46\x92\xa9\x32\xc1\x76\x58\x4a\x6e\xb7\x86\x9c\x47\x43\xae\xf6\x0f\x08\xf9\x5e\x0a\x1f\xa9\xa4\xb6\x09\xfe\x89\x37\xa3\x27\xad\x79\xb4\x26\x6b\x3d\x15\xb1\xd1\xbb\xff\x8f\x0e\x42\xb8\x6f\x28\xd6\x8b\x16\x7a\x28\x9d\xcb\x80\xbc\x40\x5e\xd5\x36\x7e\xdb\xad\x41\xde\x80\xf2\xca\x46\xc1\x41\x77\xd1\xf6\x58\x3b\x6a\xa0\x29\x40\x1b\xd4\x9b\xa8\x68\x7d\x0b\x57\xef\xf4\xf5\x14\x10\xa4\x43\xb0\x6d\x5e\xa1\x35\x9e\xc2\xd3\xe6\x89\xc8\xc8\x04\xcf\x78\x61\xc9\x9b\xc0\xb6\xd6\x6d\x58\xa8\x64\x60\x5b\xd2\x3a\xed\x10\x76\x69\x2c\x39\xee\x9d\x9e\xfc\xa7\x44\x94\xd3\xac\xff\xbf\x42\xec\x13\x13\x7a\xfb\x74\x96\x24\x5c\x88\x1e\xae\x3f\x8a\xe4\x26\x3d\x4d\x12\x96\x3c\xef\x36\x9e\xdf\xa4\xa7\xcf\x93\xa3\x7f\x02\x00\x00\xff\xff\x99\x17\x50\xe2\x7d\x07\x00\x00")
func runtimeSyntaxGentooEbuildMicroBytes() ([]byte, error) {
return bindataRead(

View file

@ -2,29 +2,27 @@
##
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))"
color identifier "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
## Highlight bash related syntax
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "-(e|d|f|r|g|u|w|x|L)\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
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 brightred "\$\{?[a-zA-Z_0-9]+\}?"
color red "\<(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\>"
color red "\<(S|D|T|PV|PF|P|PN|A)\>" "\<C(XX)?FLAGS\>" "\<LDFLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
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 magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
color brightblue "\<e(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\>"
color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>" "\<unpack\>"
color brightblue "\<(do|new)(ins|s?bin|doc|lib(\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
color brightblue "prepall(docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
color brightblue "\<(doc|ins|exe)into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
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 blue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\>"
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 yellow "#.*$"
color comment "#.*$"
## Highlight strings (doesnt work that well)
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## Trailing space is bad!
color ,green "[[:space:]]+$"
color constant.string ""(\\.|[^\"])*"" "'(\\.|[^'])*'"