diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/chem-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/chem-ini.lua | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/chem-ini.lua b/Master/texmf-dist/tex/context/base/chem-ini.lua index 10db1a1e44e..f7d10ffa272 100644 --- a/Master/texmf-dist/tex/context/base/chem-ini.lua +++ b/Master/texmf-dist/tex/context/base/chem-ini.lua @@ -32,12 +32,31 @@ function chemistry.molecule(str) return lpegmatch(moleculeparser,str) end -function commands.molecule(str) - if trace_molecules then - local rep = lpegmatch(moleculeparser,str) - report_chemistry("molecule %a becomes %a",str,rep) - context(rep) - else - context(lpegmatch(moleculeparser,str)) - end -end +interfaces.implement { + name = "molecule", + arguments = "string", + actions = function(str) + if trace_molecules then + local rep = lpegmatch(moleculeparser,str) + report_chemistry("molecule %a becomes %a",str,rep) + context(rep) + else + context(lpegmatch(moleculeparser,str)) + end + end, +} + +-- interfaces.implement { +-- name = "molecule", +-- scope = "private", +-- action = function() +-- local str = scanstring() +-- if trace_molecules then +-- local rep = lpegmatch(moleculeparser,str) +-- report_chemistry("molecule %a becomes %a",str,rep) +-- context(rep) +-- else +-- context(lpegmatch(moleculeparser,str)) +-- end +-- end, +-- } |