mirror of
https://github.com/circlecell/jsonlint-mod.git
synced 2026-01-21 05:07:49 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6b98ca98d |
@@ -123,10 +123,11 @@ parse: function parse(input) {
|
||||
}
|
||||
var errStr = '';
|
||||
if (this.lexer.showPosition) {
|
||||
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
|
||||
errStr = '第 '+(yylineno+1)+" 行解析出现错误:\n"+this.lexer.showPosition()
|
||||
+"\n期望是 "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
|
||||
} else {
|
||||
errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
|
||||
(symbol == 1 /*EOF*/ ? "end of input" :
|
||||
errStr = '第 '+(yylineno+1)+" 行解析出现错误: 不应该以 " +
|
||||
(symbol == 1 /*EOF*/ ? "作为结尾" :
|
||||
("'"+(this.terminals_[symbol] || symbol)+"'"));
|
||||
}
|
||||
this.parseError(errStr,
|
||||
|
||||
@@ -483,11 +483,12 @@ parse: function parse(input) {
|
||||
}
|
||||
var errStr = '';
|
||||
if (this.lexer.showPosition) {
|
||||
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
|
||||
errStr = '第 '+(yylineno+1)+" 行解析出现错误:\n"+this.lexer.showPosition()
|
||||
+"\n期望是 "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
|
||||
} else {
|
||||
errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
|
||||
(symbol == 1 /*EOF*/ ? "end of input" :
|
||||
("'"+(this.terminals_[symbol] || symbol)+"'"));
|
||||
errStr = '第 '+(yylineno+1)+" 行解析出现错误: 不应该以 " +
|
||||
(symbol == 1 /*EOF*/ ? "作为结尾" :
|
||||
("'"+(this.terminals_[symbol] || symbol)+"'"));
|
||||
}
|
||||
this.parseError(errStr,
|
||||
{text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
|
||||
|
||||
Reference in New Issue
Block a user