csslint: show real text of expected token if possible

now instead of the nerdy LBRACE users will see {
This commit is contained in:
tophf 2017-12-07 05:37:36 +03:00
parent 7a07ee9fd9
commit aeca16f663

View File

@ -7186,7 +7186,8 @@ TokenStreamBase.prototype = {
if (!this.match(tokenTypes)) {
token = this.LT(1);
throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name +
const info = this._tokenData[tokenTypes[0]];
throw new SyntaxError("Expected " + (info.text || info.name) +
" at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
}
},