mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Fix tests and report error at index -1 so it is a valid index
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user