jweinst1
6/24/2016 - 5:42 PM

transcompiling functions for hillary script

transcompiling functions for hillary script

//function to transpile functions in hillary script
function transpileBill(code){
	while(/.*Bill ([a-zA-Z]+) calling ([a-zA-Z ,]+):/.test(code)){
		var match = /.*Bill ([a-zA-Z]+) calling ([a-zA-Z ,]+):/.exec(code);
		var name = match[1];
		var parameters = match[2];
		code = code.replace(/Bill ([a-zA-Z]+) calling ([a-zA-Z ,]+):/, "function " + match[1] +"(" + match[2] + "){");
	}
	return code;
}