diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-12 17:15:07 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-12 17:15:07 +0100 |
commit | 8d8d528d2ad52599f11250cfc567fea4f37f2a8b (patch) | |
tree | 94286bc131ef7d994f9432febaf03fe23d10eef8 /tex/context/base/cldf-prs.lua | |
parent | f5aed2e51223c36c84c5f25a6cad238b2af59087 (diff) | |
download | context-8d8d528d2ad52599f11250cfc567fea4f37f2a8b.tar.gz |
2016-01-12 16:26:00
Diffstat (limited to 'tex/context/base/cldf-prs.lua')
-rw-r--r-- | tex/context/base/cldf-prs.lua | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tex/context/base/cldf-prs.lua b/tex/context/base/cldf-prs.lua deleted file mode 100644 index 3c3836a3e..000000000 --- a/tex/context/base/cldf-prs.lua +++ /dev/null @@ -1,72 +0,0 @@ -if not modules then modules = { } end modules ['cldf-bas'] = { - version = 1.001, - comment = "companion to cldf-ini.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- used in chem-ini.lua - -local lpegmatch, patterns = lpeg.match, lpeg.patterns -local P, R, V, Cc, Cs = lpeg.P, lpeg.R, lpeg.V, lpeg.Cc, lpeg.Cs -local format = string.format - -local cpatterns = patterns.context or { } -patterns.context = cpatterns - -local utf8character = patterns.utf8character -local cardinal = patterns.cardinal - -local leftbrace = P("{") -local rightbrace = P("}") -local backslash = P("\\") -local csname = backslash * P(1) * (1-backslash-leftbrace)^0 * P(" ")^0 -local sign = P("+") / "\\textplus " - + P("-") / "\\textminus " -local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace } -local subscript = P("_") -local superscript = P("^") - --- local scripts = P { "start", --- start = V("csname") + V("lowfirst") + V("highfirst"), --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), --- lowfirst = subscript * ( Cc("\\lohi{%s}{%s}") * V("content") * superscript + Cc("\\low{%s}" ) ) * V("content") / format, --- highfirst = superscript * ( Cc("\\hilo{%s}{%s}") * V("content") * subscript + Cc("\\high{%s}") ) * V("content") / format, --- } - --- local scripts = P { "start", --- start = (V("csname") + V("lowfirst") + V("highfirst"))^1, --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), --- lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), --- highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), --- } - -local scripted = Cs { "start", - start = (V("csname") + V("nested") + V("lowfirst") + V("highfirst") + V("character"))^1, - rest = V("csname") + V("nested") + V("lowfirst") + V("highfirst"), - csname = csname, - character = utf8character, - -- nested = leftbrace * (V("rest") + (V("character")-rightbrace))^0 * rightbrace, - nested = leftbrace * (V("start") -rightbrace)^0 * rightbrace, - -- content = Cs(V("nested") + sign^-1 * (cardinal + V("character"))), - content = V("nested") + sign^-1 * (cardinal + V("character")) + sign, - lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), - highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), - } - -cpatterns.csname = csname -cpatterns.scripted = scripted -cpatterns.nested = nested - --- print(lpegmatch(scripted,"10^-3_x")) --- print(lpegmatch(scripted,"\\L {C_5}")) --- print(lpegmatch(scripted,"\\SL{}")) --- print(lpegmatch(scripted,"\\SL{C_5}")) --- print(lpegmatch(scripted,"\\SL{C_5}")) --- print(lpegmatch(scripted,"{C_5}")) --- print(lpegmatch(scripted,"{\\C_5}")) --- print(lpegmatch(scripted,"10^-a")) - |