elua: can only specify a keyword once

This commit is contained in:
Daniel Kolesa 2014-06-02 15:26:45 +01:00
parent 819b65090b
commit be3e046865
1 changed files with 4 additions and 0 deletions

View File

@ -279,6 +279,10 @@ for i = 1, #keywords do
error("invalid keyword specifier")
end
if keywords[kwb] then
error("cannot specify the same keyword more than twice")
end
-- all sanitized, store :)
keywords[kwb] = { context = context, argnum = tonumber(argnum),
xcomment = xcmt, tonumber(n1), tonumber(n2) }