summaryrefslogtreecommitdiff
path: root/tex/context/base/chem-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/chem-ini.lua')
-rw-r--r--tex/context/base/chem-ini.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/tex/context/base/chem-ini.lua b/tex/context/base/chem-ini.lua
index a4af57256..908749092 100644
--- a/tex/context/base/chem-ini.lua
+++ b/tex/context/base/chem-ini.lua
@@ -7,6 +7,7 @@ if not modules then modules = { } end modules ['chem-ini'] = {
}
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