summaryrefslogtreecommitdiff
path: root/tex/context/base/l-lpeg.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-08-27 18:20:19 +0300
committerMarius <mariausol@gmail.com>2012-08-27 18:20:19 +0300
commit47d1a628ec1cbebf26ac6eeac1cdbdb71009e3fc (patch)
tree03b44a3953c1c3ae1665f96556bc7022a3eb81aa /tex/context/base/l-lpeg.lua
parentef3bfc9ea7ed3326ea07cd48ccf2c3d8d55ea435 (diff)
downloadcontext-47d1a628ec1cbebf26ac6eeac1cdbdb71009e3fc.tar.gz
beta 2012.08.27 17:12
Diffstat (limited to 'tex/context/base/l-lpeg.lua')
-rw-r--r--tex/context/base/l-lpeg.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/tex/context/base/l-lpeg.lua b/tex/context/base/l-lpeg.lua
index fee76ac4b..73a276f8a 100644
--- a/tex/context/base/l-lpeg.lua
+++ b/tex/context/base/l-lpeg.lua
@@ -32,7 +32,22 @@ local report = texio and texio.write_nl or print
--
-- local p = C("@") * C("!") / "%2%1"
-- lpeg.print(p) print(lpeg.match(p,"@!"))
-
+--
+-- TRICKY:
+--
+-- local P, R, Cs = lpeg.P, lpeg.R, lpeg.Cs
+--
+-- local p = Cs(P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end
+-- print(lpeg.match(Cs(p),"+10"))
+--
+-- local p = P("+")^0 * R("09")^1 * P(-1) / function(s) return "l==" .. s end
+-- print(lpeg.match(Cs(p),"+10"))
+--
+-- local p = Cs(P("+")^0 * R("09")^1 * P(-1)) / "l==%1"
+-- print(lpeg.match(Cs(p),"+10"))
+--
+-- local p = P("+")^0 * R("09")^1 * P(-1) / "l==%1"
+-- print(lpeg.match(Cs(p),"+10"))
-- local lpmatch = lpeg.match
-- local lpprint = lpeg.print