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.lua37
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,
+-- }