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 f0a559a3e9
commit bef8792b2a

View File

@ -7175,7 +7175,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);
}
},