From ce17332266dff01cfb9f83edbf10b7e080a770ca Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 21 Nov 2015 16:35:59 +0100 Subject: sync with Context as of 2015-11-21 --- lualibs-string.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lualibs-string.lua') diff --git a/lualibs-string.lua b/lualibs-string.lua index 70c66f6..e9dc2bb 100644 --- a/lualibs-string.lua +++ b/lualibs-string.lua @@ -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: -- cgit v1.2.3