fn main() {
let path = std::env::args()
.nth(1)
.expect("用法: dump_written <分子.smi>");
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("读不到 {path}: {e}"));
for tok in text.lines().filter_map(|l| l.split_whitespace().next()) {
if tok.starts_with('#') {
continue;
}
match omgkit_io::smiles::parse(tok) {
Ok(m) => println!("{tok}\t{}", omgkit_io::smiles::write(&m).smiles),
Err(_) => println!("{tok}\t<parse-error>"),
}
}
}