extern crate xswag_syntax_java as syntax;
extern crate xswag_base as base;

use base::diag;

// FIXME: import is currently wrong
const SRC: &'static str = "\
package yolo.swag;

import AlgoTools.IO;
import java.lang-*;

public private class Cheese {
	private public % yolo;
};

;
class Bread {}


";

fn main() {
    let file = base::code::FileMap::new("<test>", SRC);
    let (res, errors) = syntax::parse_compilation_unit(&file);

	match res {
		Ok(ast) => print!("{:#?}", ast),
		Err(e) => {
			// println!("{:#?}", e);
			diag::print(&e, &file, diag::PrintOptions::default());
		}
	}
    for e in &errors {
    	diag::print(&e, &file, diag::PrintOptions::default());
    }
    // println!("{:#?}", res);
    // println!("{:#?}", errors);
}

extern crate xswag_syntax_java as syntax;
extern crate xswag_base as base;

use base::diag;

// FIXME: import is currently wrong
const SRC: &'static str = "\
package yolo.swag;

import AlgoTools.IO;
import java.lang-*;

public private class Cheese {
	private public % yolo;
}


";

fn main() {
    let file = base::code::FileMap::new("<test>", SRC);
    let (res, errors) = syntax::parse_compilation_unit(&file);

    println!("{:#?}", res);
    for e in &errors {
    	diag::print(&e, &file, diag::PrintOptions::default());
    }
    // println!("{:#?}", errors);
}

--- 
+++ 
@@ -12,7 +12,10 @@
 
 public private class Cheese {
 	private public % yolo;
-}
+};
+
+;
+class Bread {}
 
 
 ";
@@ -21,9 +24,16 @@
     let file = base::code::FileMap::new("<test>", SRC);
     let (res, errors) = syntax::parse_compilation_unit(&file);
 
-    println!("{:#?}", res);
+	match res {
+		Ok(ast) => print!("{:#?}", ast),
+		Err(e) => {
+			// println!("{:#?}", e);
+			diag::print(&e, &file, diag::PrintOptions::default());
+		}
+	}
     for e in &errors {
     	diag::print(&e, &file, diag::PrintOptions::default());
     }
+    // println!("{:#?}", res);
     // println!("{:#?}", errors);
 }
Improve error printing in example
