[][src]Crate bml

BML Markup Language

Based on PEG, see the interactive parser implementation at pest.rs.

BML is used by the icarus database of higan/bsnes.


This crate works on Rust stable channel. It is on crates.io and can be used by adding bml to the dependencies in your project's Cargo.toml:

bml = "0.2"

Use ordered-multimap feature on Rust nightly channel:

bml = { version = "0.2", features = ["ordered-multimap"] }


use std::convert::TryFrom;

use bml::BmlNode;

let root = BmlNode::try_from(concat!(
	"  path: /core/www/\n",
	"  host: example.com\n",
	"  port: 80\n",
	"  service: true\n",
	"  proxy\n",
	"    host: proxy.example.com\n",
	"    port: 8080\n",
	"    authentication: plain\n",
	"  description\n",
	"    :Primary web-facing server\n",
	"    :Provides commerce-related functionality\n",
	"  // ...\n",
	"  proxy host=\"proxy.example.com\" port=\"8080\"\n",
	"    authentication: plain\n",

let (name, node) = root.nodes().next().unwrap();

assert_eq!(name, "server");
assert_eq!(node.named("port").next().unwrap().value(), "80");



BML parser error.


BML node comprising data lines() and child nodes().