summaryrefslogtreecommitdiff
path: root/tex/context/base/l-lpeg.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-08-28 22:20:18 +0300
committerMarius <mariausol@gmail.com>2012-08-28 22:20:18 +0300
commite0f42793d14b7571ae6221a15e691d28b3f76d8f (patch)
tree0ccc9ed78aee2857ea9acadb684ef6168e69f07e /tex/context/base/l-lpeg.lua
parent47d1a628ec1cbebf26ac6eeac1cdbdb71009e3fc (diff)
downloadcontext-e0f42793d14b7571ae6221a15e691d28b3f76d8f.tar.gz
beta 2012.08.28 20:00
Diffstat (limited to 'tex/context/base/l-lpeg.lua')
-rw-r--r--tex/context/base/l-lpeg.lua32
1 files changed, 0 insertions, 32 deletions
diff --git a/tex/context/base/l-lpeg.lua b/tex/context/base/l-lpeg.lua
index 73a276f8a..b00b4c3bb 100644
--- a/tex/context/base/l-lpeg.lua
+++ b/tex/context/base/l-lpeg.lua
@@ -17,38 +17,6 @@ local lpeg = require("lpeg")
local report = texio and texio.write_nl or print
--- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of
--- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases
--- where capture replacement instring happens. Interesting is that the string parsing already happens
--- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the
--- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I
--- might use it more often.
---
--- local p = P("@") / "%"
--- lpeg.print(p) print(lpeg.match(p,"@"))
---
--- local p = P("@") / "%%"
--- lpeg.print(p) print(lpeg.match(p,"@"))
---
--- 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
-- local lpp = lpeg.P