aboutsummaryrefslogtreecommitdiff
path: root/string2.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-18 17:40:32 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-18 17:40:49 -0700
commit884368593d6b05546ea0f595ac53a954999b95b4 (patch)
tree471697d653208676054f0b637f6e77cce67c604b /string2.lua
parent790b73c52a00f8e308733d15d36327c500ae26bf (diff)
Added code for handling lua keywords in as_lua_id().
Diffstat (limited to 'string2.lua')
-rw-r--r--string2.lua4
1 files changed, 2 insertions, 2 deletions
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