From d11f9bc5d3971a68dd78cdaca0b046a40a329000 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 18 Sep 2018 17:41:36 -0700 Subject: Oops, added "$" to ensure keywords with suffixes don't get changed. --- string2.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string2.lua') diff --git a/string2.lua b/string2.lua index 034c751..5995de2 100644 --- a/string2.lua +++ b/string2.lua @@ -134,7 +134,7 @@ local string2 = { 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 + if match(str, ("^_*" .. kw .. "$")) then str = "_" .. str end end @@ -145,7 +145,7 @@ local string2 = { 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 + if match(str, ("^_+" .. kw .. "$")) then str = str:sub(2, -1) end end -- cgit v1.2.3