mirror of
https://github.com/less/less.js.git
synced 2026-02-03 19:45:00 -05:00
better fix for parse-error reporting
This commit is contained in:
@@ -38,11 +38,17 @@ var less = {
|
||||
var extract = ctx.extract;
|
||||
var error = [];
|
||||
|
||||
extract[0] && error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey'));
|
||||
if (typeof(extract[0]) === 'string') {
|
||||
error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey'));
|
||||
}
|
||||
|
||||
error.push(ctx.line + ' ' + stylize(extract[1].slice(0, ctx.column), 'green')
|
||||
+ stylize(stylize(extract[1][ctx.column], 'inverse')
|
||||
+ extract[1].slice(ctx.column + 1), 'yellow'));
|
||||
extract[2] && error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey'));
|
||||
|
||||
if (typeof(extract[2]) === 'string') {
|
||||
error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey'));
|
||||
}
|
||||
error = error.join('\n') + '\033[0m\n';
|
||||
|
||||
require('sys').puts(stylize(ctx.message, 'red'), error);
|
||||
|
||||
Reference in New Issue
Block a user