aboutsummaryrefslogtreecommitdiff
path: root/lexers/pkgbuild.lua
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2016-10-06 16:47:07 +0200
committerChristian Hesse <mail@eworm.de>2016-10-06 16:47:07 +0200
commit4fdb4543b56db6b2868fd1eebe0061ee2b2889d6 (patch)
treef835026a141de8f250138a7ed327d282b99bac20 /lexers/pkgbuild.lua
parentfc575f6986d19205a3b97f1813246529c6d2fc79 (diff)
downloadvis-4fdb4543b56db6b2868fd1eebe0061ee2b2889d6.tar.gz
vis-4fdb4543b56db6b2868fd1eebe0061ee2b2889d6.tar.xz
lexers/pkgbuild: support arch specific variables
Diffstat (limited to 'lexers/pkgbuild.lua')
-rw-r--r--lexers/pkgbuild.lua30
1 files changed, 19 insertions, 11 deletions
diff --git a/lexers/pkgbuild.lua b/lexers/pkgbuild.lua
index e20e9b4..f08f114 100644
--- a/lexers/pkgbuild.lua
+++ b/lexers/pkgbuild.lua
@@ -52,39 +52,47 @@ local func = token(l.FUNCTION, word_match{
} * '()')
-- Constants.
-local constant = token(l.CONSTANT, word_match{
+local constants = {
-- We do *not* list pkgver, srcdir and startdir here.
-- These are defined by makepkg but user should not alter them.
'arch',
'backup',
'changelog',
- 'checkdepends',
- 'conflicts',
- 'depends',
'epoch',
'groups',
'install',
'license',
- 'makedepends',
- 'md5sums',
'noextract',
- 'optdepends',
'options',
'pkgbase',
'pkgdesc',
'pkgname',
'pkgrel',
'pkgver',
+ 'url',
+ 'validpgpkeys'
+}
+local arch_specific = {
+ 'checkdepends',
+ 'conflicts',
+ 'depends',
+ 'makedepends',
+ 'md5sums',
+ 'optdepends',
'provides',
'replaces',
'sha1sums',
'sha256sums',
'sha384sums',
'sha512sums',
- 'source',
- 'url',
- 'validpgpkeys'
-})
+ 'source'
+}
+for _, field in ipairs(arch_specific) do
+ for _,arch in ipairs({ '', 'i686', 'x86_64' }) do
+ table.insert(constants, field..(arch ~= '' and '_'..arch or ''))
+ end
+end
+local constant = token(l.CONSTANT, word_match(constants))
-- Identifiers.
local identifier = token(l.IDENTIFIER, l.word)