From 0ca523e0c5ef7956baa58df0f652d2f4707984f7 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 14 Oct 2016 11:57:56 +0200 Subject: [PATCH] small refactoring --- libs/module.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/module.lua b/libs/module.lua index 4c7a048..27a4a63 100644 --- a/libs/module.lua +++ b/libs/module.lua @@ -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