From 884368593d6b05546ea0f595ac53a954999b95b4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 18 Sep 2018 17:40:32 -0700 Subject: Added code for handling lua keywords in as_lua_id(). --- string2.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string2.lua') diff --git a/string2.lua b/string2.lua index dd0af98..034c751 100644 --- a/string2.lua +++ b/string2.lua @@ -131,7 +131,7 @@ local string2 = { end end) str = gsub(str, "^_*%d", "_%1") - if match(str, "^_*[a-z]*$") then + if match(str, "^_*[abdefgilnortuw][aefhilnoru][acdefiklnoprstu]*$") then for _index_0 = 1, #lua_keywords do local kw = lua_keywords[_index_0] if match(str, ("^_*" .. kw)) then @@ -142,7 +142,7 @@ local string2 = { return str end, from_lua_id = function(str) - if match(str, "^_+[a-z]*$") then + if match(str, "^_+[abdefgilnortuw][aefhilnoru][acdefiklnoprstu]*$") then for _index_0 = 1, #lua_keywords do local kw = lua_keywords[_index_0] if match(str, ("^_+" .. kw)) then -- cgit v1.2.3