diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
commit | b55577d0998160c0174e250b542016ecd6ca9056 (patch) | |
tree | 27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/chem-ini.lua | |
parent | 624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff) | |
download | context-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz |
2015-05-15 23:06:00
Diffstat (limited to 'tex/context/base/chem-ini.lua')
-rw-r--r-- | tex/context/base/chem-ini.lua | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/tex/context/base/chem-ini.lua b/tex/context/base/chem-ini.lua index 10db1a1e4..f7d10ffa2 100644 --- a/tex/context/base/chem-ini.lua +++ b/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, +-- } |