small refactoring
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ nop, id = function() end, function(v) return v end
|
||||
|
||||
function define(self, k, v, private)
|
||||
if type(k) ~= 'string' or not strfind(k, '^[_%a][_%w]*') then error('Invalid identifier "%s".', k) end
|
||||
local _, _, prefix, suffix = strfind(k, '^(.?.?.?.?)([_%a][_%w]*)')
|
||||
local _, _, prefix, suffix = strfind(k, '^(.?.?.?.?)([_%a].*)')
|
||||
local module = loaded[self]
|
||||
module.defined[k] = module.defined[k] and error('Duplicate identifier "%s".', k) or true
|
||||
module.fields[k] = v
|
||||
|
||||
Reference in New Issue
Block a user