Skip to content

Instantly share code, notes, and snippets.

@jamorton
Created April 5, 2012 17:09
Show Gist options
  • Save jamorton/2312564 to your computer and use it in GitHub Desktop.
Save jamorton/2312564 to your computer and use it in GitHub Desktop.
let input = result::get(io::read_whole_file_str(filename));
let start = str::find_str(input, "{{");
let end = str::find_str(input, "}}");
if option::is_none(start) || option::is_none(end) {
error("invalid rom file");
ret;
}
let s = option::get(start);
let e = option::get(end);
if s > e {
error("invalid rom file");
ret;
}
let data = str::slice(input, s + 2u, e);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment