//! Isbfc is an optimizing brainfuck compiler targeting x86_64 Linux
//!
//! # Examples
//! ```
//! extern crate isbfc;
//!
//! fn main() {
//!     // 2048 is the tape length to use
//!     let assembly = isbfc::parse(",[.,]").optimize().compile(2048);
//!     print!("{}", assembly);
//! }
//! ```

use std::fmt;

mod token;
mod parser;
mod optimizer;
mod compiler;

pub use token::Token;
pub use parser::parse;


/// Intermediate representation used by isbfc
pub struct IsbfcIR {
    /// Syntax tree of tokens
    pub tokens: Vec<Token>
}

impl fmt::Debug for IsbfcIR {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.tokens.fmt(f)
    }
}

use std::fmt;

mod token;
mod parser;
mod optimizer;
mod compiler;

pub use token::Token;
pub use parser::parse;


/// Intermediate representation used by isbfc
pub struct IsbfcIR {
    /// Syntax tree of tokens
    pub tokens: Vec<Token>
}

impl fmt::Debug for IsbfcIR {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.tokens.fmt(f)
    }
}

--- 
+++ 
@@ -1,3 +1,16 @@
+//! Isbfc is an optimizing brainfuck compiler targeting x86_64 Linux
+//!
+//! # Examples
+//! ```
+//! extern crate isbfc;
+//!
+//! fn main() {
+//!     // 2048 is the tape length to use
+//!     let assembly = isbfc::parse(",[.,]").optimize().compile(2048);
+//!     print!("{}", assembly);
+//! }
+//! ```
+
 use std::fmt;
 
 mod token;
Add crate level documentation with example
