1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! `chematic-smiles` — OpenSMILES parser, writer, and canonical SMILES generator.
//!
//! # Quick start
//! ```rust
//! use chematic_smiles::{parse, write, canonical_smiles};
//!
//! let mol = parse("c1ccccc1").unwrap(); // benzene
//! assert_eq!(mol.atom_count(), 6);
//! assert_eq!(mol.bond_count(), 6);
//!
//! // Non-canonical write (DFS order).
//! let smiles = write(&mol);
//! let mol2 = parse(&smiles).unwrap();
//! assert_eq!(mol.atom_count(), mol2.atom_count());
//!
//! // Canonical SMILES (stable, unique).
//! let c1 = canonical_smiles(&mol);
//! let c2 = canonical_smiles(&parse("C1=CC=CC=C1").unwrap()); // Kekule benzene
//! // c1 and c2 differ because aromaticity differs, but both are stable.
//! assert_eq!(c1, canonical_smiles(&parse(&c1).unwrap()));
//! ```
//!
//! # Design
//! - Pure Rust: no C/C++ FFI, no unsafe.
//! - Single-pass recursive-descent parser; no separate lexer phase.
//! - WASM-compatible (no filesystem I/O, no threads).
pub use canonical_smiles;
pub use SmilesError;
pub use parse;
pub use write;