packages/moon/src/compiler/lexer/lexer.js
function lexError(message, input, index) {
	let lexMessage = message + "\n\n";

	// Show input characters surrounding the source of the error.
	for (
		let i = Math.max(0, index - 16);
		i < Math.min(index + 16, input.length);
		i++
	) {
		lexMessage += input[i];
	}

	error(lexMessage);
}
function lexError(message, input, index) {
	let lexMessage = message + "\n\n";

	// Show input characters surrounding the source of the error.
	for (
		let i = Math.max(0, index - 16);
		i < Math.min(index + 16, input.length);
		i++
	) {
		lexMessage += input[i];
	}

	error(lexMessage);
}
function lexError ( message , input , index ) { let lexMessage = message + "\n\n" ; // Show input characters surrounding the source of the error. for ( let i = Math . max ( 0 , index - 16 ) ; i < Math . min ( index + 16 , input . length ) ; i ++ ) { lexMessage += input [ i ] ; } error ( lexMessage ) ; }
Logs a lexer error message to the console along with the surrounding
characters.

@param {string} message
@param {string} input
@param {number} index
Logs a lexer error message to the console along with the surrounding characters .