aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-04-26 14:55:18 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-04-26 14:55:18 -0300
commitde794a6527058e75b674118b35f39dcbb13e88b1 (patch)
tree3699604543f09398d7aa62729309c3685354ed83 /testes
parent8b83417de982d068bd92e0428a42ca0cdd909789 (diff)
downloadlua-de794a6527058e75b674118b35f39dcbb13e88b1.tar.gz
lua-de794a6527058e75b674118b35f39dcbb13e88b1.tar.bz2
lua-de794a6527058e75b674118b35f39dcbb13e88b1.zip
Towards release 5.4.7
Diffstat (limited to 'testes')
-rw-r--r--testes/pm.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/testes/pm.lua b/testes/pm.lua
index 44454dff..e5e3f7a7 100644
--- a/testes/pm.lua
+++ b/testes/pm.lua
@@ -56,7 +56,8 @@ assert(f(" \n\r*&\n\r xuxu \n\n", "%g%g%g+") == "xuxu")
56 56
57-- Adapt a pattern to UTF-8 57-- Adapt a pattern to UTF-8
58local function PU (p) 58local function PU (p)
59 -- break '?' into each individual byte of a character 59 -- reapply '?' into each individual byte of a character.
60 -- (For instance, "รก?" becomes "\195?\161?".)
60 p = string.gsub(p, "(" .. utf8.charpattern .. ")%?", function (c) 61 p = string.gsub(p, "(" .. utf8.charpattern .. ")%?", function (c)
61 return string.gsub(c, ".", "%0?") 62 return string.gsub(c, ".", "%0?")
62 end) 63 end)