summaryrefslogtreecommitdiff
blob: c775e2988b461dea317acfc727e3f934be1d8c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From 7051588fee7a20a69c67c8899b3e6c35ebf51fbf Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sat, 25 Aug 2012 23:03:22 -0400
Subject: [PATCH] gentoo syntax: update

Update to newer EAPIs, and fold in updated shell changes too.
Much of this is based on work by Davide.

Reported-by: Davide Pesavento <pesa@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 doc/syntax/gentoo.nanorc | 46 +++++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 19 deletions(-)

diff --git a/doc/syntax/gentoo.nanorc b/doc/syntax/gentoo.nanorc
index 2ad1597..ad89fce 100644
--- a/doc/syntax/gentoo.nanorc
+++ b/doc/syntax/gentoo.nanorc
@@ -2,30 +2,38 @@
 ##
 syntax "ebuild" "\.e(build|class)$"
 ## All the standard portage functions
-color brightgreen "^src_(unpack|prepare|configure|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
+color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>"
+color brightgreen "^pkg_(config|nofetch|pretend|setup|(pre|post)(inst|rm))\>"
+color brightgreen "\<default(_pkg_nofetch)?\>"
 ## 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 "\<(declare|eval|exec|let)\>"
-color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
-color green "-[edfgruwxL]\>"
-color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
+color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
+color green "\<(declare|eval|exec|export|let|local)\>"
+color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
+color green "-[defhnrsuwxzL]\>"
+color green "-(eq|ne|gt|lt|ge|le)\>"
 ## Highlight variables ... official portage ones in red, all others in bright red
-color brightred "\$\{?[a-zA-Z_0-9]+\}?"
-color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|(P|R)?DEPEND|PROVIDE|PROPERTIES|RESTRICT|USERLAND)\>"
-color red "\<(S|D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|ROOT|WORKDIR)\>" "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
-color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPPED)\>" "\<WANT_AUTO(CONF|MAKE)\>" "\<AT_M4DIR\>"
+color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
+color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:digit:]]|@)+\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
+color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|(P|R)?DEPEND|PROVIDE|PROPERTIES|REQUIRED_USE|RESTRICT|USERLAND)\>"
+color red "\<(S|E?D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|EPREFIX|E?ROOT|WORKDIR)\>"
+color red "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
+color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPPED)\>"
+color red "\<(PATCHES|(HTML_)?DOCS)\>" "\<WANT_(AUTO(CONF|MAKE)|LIBTOOL)\>" "\<AT_M4DIR\>"
 ## Highlight portage commands
-color magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
-color brightblue "\<e(begin|end|conf|install|make|qmake[34]|ant|(qa)?warn|infon?|error|log|patch|new(group|user))\>"
-color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make))\>"
-color brightblue "\<built_with_use\>" "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
-color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>"
+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(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 "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
+color brightblue "\<(die|has|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(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
-color brightblue "prepall(docs|info|man|strip)?" "prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)"
+color brightblue "\<do(compress|python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
+color brightblue "\<prepall(docs|info|man|strip)?\>" "\<prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)\>"
 color brightblue "\<(doc|ins|exe)?into\>" "\<(f|games)(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-(arch(-kernel)?|export|has-(tls|openmp))\>"
 ## Highlight common commands used in ebuilds
-color blue "\<make\>" "\<(awk|cat|cd|chmod|chown|cp|echo|env|export|find|e?grep|ln|mkdir|mv|rm|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)\>"
 ## Highlight comments (doesnt work that well)
 color yellow "(^|[[:space:]])#.*$"
 ## Highlight strings (doesnt work that well)
@@ -35,7 +43,7 @@ color ,green "[[:space:]]+$"
 
 ## Here is an example for Portage control files
 ##
-syntax "/etc/portage" "\.(keywords|mask|unmask|use)(/.+)?$"
+syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
 ## Base text:
 color green "^.+$"
 ## Use flags:
-- 
1.8.3.2

--- a/doc/syntax/gentoo.nanorc
+++ b/doc/syntax/gentoo.nanorc
@@ -61,3 +61,5 @@ color cyan "^[[:space:]]*.*/"
 color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
 ## Comments:
 color yellow "#.*$"
+## Trailing space is bad!
+color ,green "[[:space:]]+$"