Reaction mechanisms
A mechanism captures a multi-step reaction pathway with optional spectator ions.
Syntax
Section titled “Syntax”mechanism{ label: reaction label: reaction spectator: ion1 ion2 ...}Each line is a key: value pair. Keys other than spectator are
step labels (e.g. step1, step2).
Example: SN2 mechanism
Section titled “Example: SN2 mechanism”mechanism{
step1: OH- + CH3Br -> CH3OH + Br-
spectator: Na+
}asciichem gem to see this rendered.
Example: multi-step
Section titled “Example: multi-step”mechanism{
step1: A + B -> C
step2: C -> D + E
spectator: Na+ K+
}asciichem gem to see this rendered.
Electron-flow markers
Section titled “Electron-flow markers”A step value may carry the electron-flow arrows drawn for it:
| flow: SOURCE > TARGET clauses, semicolon-separated. The marker
names what the arrow starts at (a bond or species) and where it
points — verbatim names, because atom-level binding needs references
the mechanism text does not yet carry.
mechanism{
step1: OH^- + CH_3-Br -> CH_3-OH + Br^- | flow: OH^- > C; C-Br > Br^-
spectator: Na^+
}asciichem gem to see this rendered.
Flows are model data (Mechanism::Flow), carried by the step graph
and the wire form, and re-emitted in canonical text. An unknown
clause kind or a malformed arrow raises ParseError — never a
silent drop.
Validation (v0.18+)
Section titled “Validation (v0.18+)”Each entry must have a : separator. Malformed entries raise
ParseError at parse time with the offending line number.
CML wire (v0.11+)
Section titled “CML wire (v0.11+)”Emits as <reaction> with <mechanism> child:
<reaction> <mechanism title="mechanism{...}" convention="asciichem:text"/></reaction>Future enhancement: structural <reactionStepList> with per-step
reaction elements.