diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2015-11-21 16:35:59 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2015-11-21 16:35:59 +0100 |
commit | ce17332266dff01cfb9f83edbf10b7e080a770ca (patch) | |
tree | fc842ed016caa9f5d20de15b8f9a706c009de5e9 /lualibs-string.lua | |
parent | 4295a3eb51db73a87774d59fb3a38a54690319f7 (diff) | |
download | lualibs-ce17332266dff01cfb9f83edbf10b7e080a770ca.tar.gz |
sync with Context as of 2015-11-21
Diffstat (limited to 'lualibs-string.lua')
-rw-r--r-- | lualibs-string.lua | 7 |
1 files changed, 4 insertions, 3 deletions
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: |