Skip to content

Commit

Permalink
lexers/pkgbuild: support arch specific variables
Browse files Browse the repository at this point in the history
  • Loading branch information
eworm-de committed Oct 6, 2016
1 parent fc575f6 commit 4fdb454
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions lexers/pkgbuild.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4fdb454

Please sign in to comment.