diff options
author | Marius <mariausol@gmail.com> | 2013-05-19 20:40:34 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-05-19 20:40:34 +0300 |
commit | 13ec4b540e0d46c97fd7b089e0b7413da81e0a9f (patch) | |
tree | bebfa563a17c06b3bd3bf8f6f4ba6d025e00d107 /tex/context/base/meta-tex.lua | |
parent | 69ad13650cda027526271179e95b5294694143a1 (diff) | |
download | context-13ec4b540e0d46c97fd7b089e0b7413da81e0a9f.tar.gz |
beta 2013.05.19 19:27
Diffstat (limited to 'tex/context/base/meta-tex.lua')
-rw-r--r-- | tex/context/base/meta-tex.lua | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/tex/context/base/meta-tex.lua b/tex/context/base/meta-tex.lua index c29498ad1..117d604b3 100644 --- a/tex/context/base/meta-tex.lua +++ b/tex/context/base/meta-tex.lua @@ -1,38 +1,38 @@ -if not modules then modules = { } end modules ['meta-tex'] = { - version = 1.001, - comment = "companion to meta-tex.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - ---~ local P, C, lpegmatch = lpeg.P, lpeg.C, lpeg.match - --- local left = P("[") --- local right = P("]") --- local space = P(" ") --- local argument = left * C((1-right)^1) * right --- local pattern = (argument + space)^0 - --- function metapost.sometxt(optional,str) --- if optional == "" then --- context.sometxta(str) --- else --- local one, two = lpegmatch(pattern,optional) --- if two then --- context.sometxtc(one,two,str) --- elseif one then --- context.sometxtb(one,str) --- else --- context.sometxta(str) --- end --- end --- end - -local P, Cs, lpegmatch = lpeg.P, lpeg.Cs, lpeg.match - -local pattern = Cs((P([[\"]]) + P([["]])/"\\quotedbl{}" + P(1))^0) -- or \char - -function metapost.escaped(str) - context(lpegmatch(pattern,str)) -end +if not modules then modules = { } end modules ['meta-tex'] = {
+ version = 1.001,
+ comment = "companion to meta-tex.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--~ local P, C, lpegmatch = lpeg.P, lpeg.C, lpeg.match
+
+-- local left = P("[")
+-- local right = P("]")
+-- local space = P(" ")
+-- local argument = left * C((1-right)^1) * right
+-- local pattern = (argument + space)^0
+
+-- function metapost.sometxt(optional,str)
+-- if optional == "" then
+-- context.sometxta(str)
+-- else
+-- local one, two = lpegmatch(pattern,optional)
+-- if two then
+-- context.sometxtc(one,two,str)
+-- elseif one then
+-- context.sometxtb(one,str)
+-- else
+-- context.sometxta(str)
+-- end
+-- end
+-- end
+
+local P, Cs, lpegmatch = lpeg.P, lpeg.Cs, lpeg.match
+
+local pattern = Cs((P([[\"]]) + P([["]])/"\\quotedbl{}" + P(1))^0) -- or \char
+
+function metapost.escaped(str)
+ context(lpegmatch(pattern,str))
+end
|