aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-10-06 21:34:24 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-10-06 21:34:24 +0200
commit550455b5ab15f1fe6a2cfe6e3cea9e6799d07606 (patch)
treef0a6c5e9419e4eea23615e8dda93e411ded91d9d
parentb2b5c9e3fbce56ae131cb8cfe3808913566754c5 (diff)
parent4fdb4543b56db6b2868fd1eebe0061ee2b2889d6 (diff)
downloadvis-550455b5ab15f1fe6a2cfe6e3cea9e6799d07606.tar.gz
vis-550455b5ab15f1fe6a2cfe6e3cea9e6799d07606.tar.xz
Merge branch 'pkgbuild-2' of https://github.com/eworm-de/vis
-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)