summaryrefslogtreecommitdiff
path: root/lualibs-lpeg.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-09-15 21:15:17 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-09-15 21:15:17 +0200
commit96ba331ed3395bd61f377e5c176b372d38e078da (patch)
treeacd09ab82fe6fbbab851e9e6a5d10afca411dc79 /lualibs-lpeg.lua
parent9613f4348a811be2f2751873cd98072a9378c9d4 (diff)
downloadlualibs-96ba331ed3395bd61f377e5c176b372d38e078da.tar.gz
sync with Context as of 2013-09-15
Diffstat (limited to 'lualibs-lpeg.lua')
-rw-r--r--lualibs-lpeg.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lualibs-lpeg.lua b/lualibs-lpeg.lua
index 78b503b..cafa18a 100644
--- a/lualibs-lpeg.lua
+++ b/lualibs-lpeg.lua
@@ -126,6 +126,15 @@ local utfoffset = utfbom_32_be * Cc(4) + utfbom_32_le * Cc(4)
local utf8next = R("\128\191")
+patterns.utfbom_32_be = utfbom_32_be
+patterns.utfbom_32_le = utfbom_32_le
+patterns.utfbom_16_be = utfbom_16_be
+patterns.utfbom_16_le = utfbom_16_le
+patterns.utfbom_8 = utfbom_8
+
+patterns.utf_16_be_nl = P("\000\r\000\n") + P("\000\r") + P("\000\n")
+patterns.utf_16_le_nl = P("\r\000\n\000") + P("\r\000") + P("\n\000")
+
patterns.utf8one = R("\000\127")
patterns.utf8two = R("\194\223") * utf8next
patterns.utf8three = R("\224\239") * utf8next * utf8next