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.moon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string2.moon') diff --git a/string2.moon b/string2.moon index 27e7122..2259272 100644 --- a/string2.moon +++ b/string2.moon @@ -67,7 +67,7 @@ string2 = { -- This pattern is guaranteed to match all keywords, but also matches some other stuff. if match str, "^_*[abdefgilnortuw][aefhilnoru][acdefiklnoprstu]*$" for kw in *lua_keywords - if match str, ("^_*"..kw) + if match str, ("^_*"..kw.."$") str = "_"..str return str @@ -77,7 +77,7 @@ string2 = { -- This pattern is guaranteed to match all keywords, but also matches some other stuff. if match str, "^_+[abdefgilnortuw][aefhilnoru][acdefiklnoprstu]*$" for kw in *lua_keywords - if match str, ("^_+"..kw) + if match str, ("^_+"..kw.."$") str = str\sub(2,-1) str = gsub(str, "^_(_*%d.*)", "%1") str = gsub(str, "_", " ") -- cgit v1.2.3