summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua
index 3b1a0003ff9..e9dc2bbbcff 100644
--- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua
+++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua
@@ -94,7 +94,7 @@ end
-- return not find(str,"%S")
-- end
-local pattern = P(" ")^0 * P(-1)
+local pattern = P(" ")^0 * P(-1) -- maybe also newlines
-- patterns.onlyspaces = pattern
@@ -192,10 +192,11 @@ string.itself = function(s) return s end
-- also handy (see utf variant)
-local pattern = Ct(C(1)^0) -- string and not utf !
+local pattern_c = Ct( C(1) ^0) -- string and not utf !
+local pattern_b = Ct((C(1)/byte)^0)
-function string.totable(str)
- return lpegmatch(pattern,str)
+function string.totable(str,bytes)
+ return lpegmatch(bytes and pattern_b or pattern_c,str)
end
-- handy from within tex: