include "compiler.alh"
include "primitives.alh"

Void function main(model : Element):
	String code
	code = ""
	code = code + "include \"primitives.alh\"\n"
	code = code + "Void function test_function():\n"
	code = code + "    log(\"Function!\")\n"
	code = code + "    abcd\n"
	code = code + "    return!"

	log("Got code: ")
	log(code)
	
	Element result
	result = compile_code(code)

	log("Executing result: " + cast_value(result))
	if (element_eq(result, read_root())):
		log("ERROR: compilation error")
	else:
		result()

	return!
