Fix tests and report error at index -1 so it is a valid index

This commit is contained in:
Luke Page
2012-12-09 15:42:14 +00:00
parent f49694fc8f
commit 2d73502955
4 changed files with 4 additions and 4 deletions

View File

@@ -349,7 +349,7 @@ less.Parser = function Parser(env) {
}
if (level != 0) {
error = new(LessError)({
index: i,
index: i-1,
type: 'Parse',
message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
filename: env.filename

View File

@@ -1,2 +1,2 @@
ParseError: Syntax Error on line 1 in {pathrel}parse-error-curly-bracket.less:1:0
ParseError: missing opening `{` in {pathrel}parse-error-curly-bracket.less:1:1
1 }}

View File

@@ -1,2 +1,2 @@
ParseError: Syntax Error on line 1 in {path}parse-error-curly-bracket.less:1:0
ParseError: missing opening `{` in {path}parse-error-curly-bracket.less:1:1
1 }}

View File

@@ -1,2 +1,2 @@
ParseError: missing closing `}` in {path}parse-error-missing-bracket.less:3:1
ParseError: missing closing `}` in {path}parse-error-missing-bracket.less:3:0
2 background-color: #fff;