diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-05-08 17:50:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-05-08 17:50:10 -0300 |
commit | 262dc5729a28b2bad0b6413d4eab2290d14395cf (patch) | |
tree | c92cbf6c6d5d88bc352dd71f7f27be4dd44cf16f /testes | |
parent | 9d985db7bb09c92b5b3fa660fffe5907d01e6a02 (diff) | |
download | lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.tar.gz lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.tar.bz2 lua-262dc5729a28b2bad0b6413d4eab2290d14395cf.zip |
Details
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
Diffstat (limited to 'testes')
-rw-r--r-- | testes/pm.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testes/pm.lua b/testes/pm.lua index 44454dff..f5889fcd 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 |
58 | local function PU (p) | 58 | local function PU (p) |
59 | -- break '?' into each individual byte of a character | 59 | -- distribute '?' 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) |