fn run(source: String) -> bool {
	// Scanning
	let (tokens, errors) = scanner::scan(&source);

	if !errors.is_empty() {
		errors::report_errors(&source, "Scan", &errors);

		return true;
	}

	// Parsing
	let (statements, errors) = parser::parse(tokens);

	if !errors.is_empty() {
		errors::report_errors(&source, "Parse", &errors);

		return true;
	}

	// Resolving
	if let Err(error) = resolver::resolve(&statements) {
		errors::report_errors(&source, "Resolve", &[error]);

		true

	// Interpreting 😇
	} else if let Err(error) = interpreter::interpret(&statements) {
		errors::report_errors(&source, "Runtime", &[error]);

		true
	} else {
		false
	}
}
// TODO: maybe change the signature to return parsed tree of vars and functions
// so that we can merge that with the last tree in the REPL mode - we want
// things to be persistent dont we? (COMBAK: when implementing a better repl)
//
// bool indicates if any error(s) occurred
maybe change the signature to return parsed tree of vars and functions
so that we can merge that with the last tree in the REPL mode - we want
things to be persistent dont we. (COMBAK: when implementing a better repl)

bool indicates if any error(s) occurred
maybe change the signature to return parsed tree of vars and functions so that we can merge that with the last tree in the REPL mode - we want things to be persistent dont we . ( COMBAK : when implementing a better repl ) bool indicates if any error ( s ) occurred
fn run(source: String) -> bool {
	// Scanning
	let (tokens, errors) = scanner::scan(&source);
	if !errors.is_empty() {
		errors::report_errors(&source, "Scan", &errors);
		return true;
	}
	// Parsing
	let (statements, errors) = parser::parse(tokens);
	if !errors.is_empty() {
		errors::report_errors(&source, "Parse", &errors);
		return true;
	}
	// Resolving
	if let Err(error) = resolver::resolve(&statements) {
		errors::report_errors(&source, "Resolve", &[error]);
		true
	// Interpreting 😇
	} else if let Err(error) = interpreter::interpret(&statements) {
		errors::report_errors(&source, "Runtime", &[error]);
		true
	} else {
		false
	}
}
fn run ( source : String ) -> bool { // Scanning let ( tokens , errors ) = scanner :: scan ( & source ) ; if ! errors . is_empty ( ) { errors :: report_errors ( & source , " " , & errors ) ; return true ; } // Parsing let ( statements , errors ) = parser :: parse ( tokens ) ; if ! errors . is_empty ( ) { errors :: report_errors ( & source , " " , & errors ) ; return true ; } // Resolving if let Err ( error ) = resolver :: resolve ( & statements ) { errors :: report_errors ( & source , " " , & [ error ] ) ; true // Interpreting 😇 } else if let Err ( error ) = interpreter :: interpret ( & statements ) { errors :: report_errors ( & source , " " , & [ error ] ) ; true } else { false } }
TODO: maybe change the signature to return parsed tree of vars and functions
so that we can merge that with the last tree in the REPL mode - we want
things to be persistent dont we?
TODO : maybe change the signature to return parsed tree of vars and functions so that we can merge that with the last tree in the REPL mode - we want things to be persistent dont we?
source
String
source
String