lib/error.js
function(lines, error) {
        var lineNumber = error.line - 1;
        var result = [
            renderLine(lineNumber, lines[lineNumber]),
            renderPointer(error.col)
        ];
        var i = lineNumber - 1;
        var linesAround = 2;
        while (i >= 0 && i >= (lineNumber - linesAround)) {
            result.unshift(renderLine(i, lines[i]));
            i--;
        }
        i = lineNumber + 1;
        while (i < lines.length && i <= (lineNumber + linesAround)) {
            result.push(renderLine(i, lines[i]));
            i++;
        }
        result.unshift(error.message + " (line: " + error.line + ", col: " + error.col + ", pos: " + error.pos + ")");
        return result.join('\n');

    }
function(lines, error) {
        var lineNumber = error.line - 1;
        var result = [
            renderLine(lineNumber, lines[lineNumber]),
            renderPointer(error.col)
        ];
        var i = lineNumber - 1;
        var linesAround = 2;
        while (i >= 0 && i >= (lineNumber - linesAround)) {
            result.unshift(renderLine(i, lines[i]));
            i--;
        }
        i = lineNumber + 1;
        while (i < lines.length && i <= (lineNumber + linesAround)) {
            result.push(renderLine(i, lines[i]));
            i++;
        }
        result.unshift(error.message + " (line: " + error.line + ", col: " + error.col + ", pos: " + error.pos + ")");
        return result.join('\n');

    }
function ( lines , error ) { var lineNumber = error . line - 1 ; var result = [ renderLine ( lineNumber , lines [ lineNumber ] ) , renderPointer ( error . col ) ] ; var i = lineNumber - 1 ; var linesAround = 2 ; while ( i >= 0 && i >= ( lineNumber - linesAround ) ) { result . unshift ( renderLine ( i , lines [ i ] ) ) ; i -- ; } i = lineNumber + 1 ; while ( i < lines . length && i <= ( lineNumber + linesAround ) ) { result . push ( renderLine ( i , lines [ i ] ) ) ; i ++ ; } result . unshift ( error . message + " (line: " + error . line + ", col: " + error . col + ", pos: " + error . pos + ")" ) ; return result . join ( '\n' ) ; }
Create error message with explanation

@example
```
Error: Unexpected token: name (foo) (line: 7437, col: 12, pos: 312592)
7435 |        };
7436 |    } else {
7437 |        let foo = 'bar';
--------------------^
7438 |        result = {
7439 |            result: 0
```

@param lines
@param error
Create error message with explanation