Skip to content

Instantly share code, notes, and snippets.

@Whiteknight
Created February 18, 2012 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whiteknight/1860547 to your computer and use it in GitHub Desktop.
Save Whiteknight/1860547 to your computer and use it in GitHub Desktop.
pure winxed-to-pbc compiler
function get_winxed_compiler(string pbc_name = "winxedst3.pbc")
{
var wx_pbc = load_packfile(pbc_name);
for (var load_sub in wx_pbc.subs_by_tag("load"))
load_sub();
return compreg("winxed");
}
function main[main](var args)
{
var wx_compreg = get_winxed_compiler();
string winxedcc_name = args.shift();
string infile_name = args.shift();
string outfile_name = args.shift();
string code = (new 'FileHandle').readall(infile_name);
var pf = wx_compreg.compile(code);
pf.write_to_file(outfile_name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment