csslint: fire startdocument on {

This commit is contained in:
tophf 2017-06-10 12:41:44 +03:00
parent 0817a03b61
commit 2e86c95842
2 changed files with 3 additions and 2 deletions

View File

@ -1675,7 +1675,6 @@ Parser.prototype = function() {
} }
tokenStream.mustMatch(Tokens.LBRACE); tokenStream.mustMatch(Tokens.LBRACE);
this._readWhitespace();
this.fire({ this.fire({
type: "startdocument", type: "startdocument",
@ -1685,6 +1684,8 @@ Parser.prototype = function() {
col: token.startCol col: token.startCol
}); });
this._readWhitespace(); // Stylus hack
var ok = true; var ok = true;
while (ok) { while (ok) {
switch (tokenStream.peek()) { switch (tokenStream.peek()) {

View File

@ -1576,7 +1576,7 @@ function fromMozillaFormat() {
} }
function backtrackTo(parser, tokenType, startEnd) { function backtrackTo(parser, tokenType, startEnd) {
var tokens = parser._tokenStream._lt; var tokens = parser._tokenStream._lt;
for (var i = tokens.length - 2; i >= 0; --i) { for (var i = parser._tokenStream._ltIndex - 1; i >= 0; --i) {
if (tokens[i].type == tokenType) { if (tokens[i].type == tokenType) {
return {line: tokens[i][startEnd+"Line"], col: tokens[i][startEnd+"Col"]}; return {line: tokens[i][startEnd+"Line"], col: tokens[i][startEnd+"Col"]};
} }