 		}
 		
 		guard let compiledSource = compileLionessSourceCode(source) else {
-			// TODO: throw error
-			return
+			throw RunnerError.runFailed
 		}
 
 		var fullBytecode = compiledStdLib


public enum RunnerError: Error {
	case registerNotFound
}

/// Runs through full pipeline, from lexer to interpreter
public class Runner {
	
	fileprivate var logDebug: Bool
	
	fileprivate var source: String?
	

	
	func run(_ source: String, get varName: String) throws -> Double {
		
		let stdLib = try StdLib().stdLibCode()
		
		guard let compiledStdLib = compileLionessSourceCode(stdLib) else {
			throw RunnerError.stdlibFailed
		}
		
		guard let compiledSource = compileLionessSourceCode(source) else {
			throw RunnerError.runFailed
		}

		let bytecode = compiledStdLib + compiledSource
		
		let interpreter = try BytecodeInterpreter(bytecode: bytecode)
		try interpreter.interpret()
	
		guard let reg = compiler.getCompiledRegister(for: varName) else {
			throw RunnerError.registerNotFound
		}
		
		do {
			return try interpreter.getRegValue(for: reg)
		} catch {
