summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/chem-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/chem-ini.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/chem-ini.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/chem-ini.lua b/Master/texmf-dist/tex/context/base/chem-ini.lua
index 27b73484008..90874909207 100644
--- a/Master/texmf-dist/tex/context/base/chem-ini.lua
+++ b/Master/texmf-dist/tex/context/base/chem-ini.lua
@@ -1,12 +1,13 @@
if not modules then modules = { } end modules ['chem-ini'] = {
version = 1.001,
- comment = "companion to chem-ini.tex",
+ comment = "companion to chem-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local format, texsprint = string.format, tex.sprint
+local lpegmatch = lpeg.match
local trace_molecules = false trackers.register("chemistry.molecules", function(v) trace_molecules = v end)
@@ -60,15 +61,15 @@ local parser = lpeg.Cs((csname + lowhigh + highlow + low + high + sign + any
chemicals.moleculeparser = parser -- can be used to avoid functioncall
function chemicals.molecule(str)
- return parser:match(str)
+ return lpegmatch(parser,str)
end
function commands.molecule(str)
if trace_molecules then
- local rep = parser:match(str)
+ local rep = lpegmatch(parser,str)
logs.report("chemistry", "molecule %s => %s",str,rep)
texsprint(ctxcatcodes,rep)
else
- texsprint(ctxcatcodes,parser:match(str))
+ texsprint(ctxcatcodes,lpegmatch(parser,str))
end
end