Grammar error messages 1/3: Improve the missing rule message
New wording is more similar to wording used in various programming languages and it is in line with the duplicate rule message. Part of #371.
This commit is contained in:
parent
eb67cbedb4
commit
85fb8aaa0e
|
@ -10,7 +10,7 @@ function reportMissingRules(ast) {
|
|||
rule_ref: function(node) {
|
||||
if (!asts.findRule(ast, node.name)) {
|
||||
throw new GrammarError(
|
||||
"Referenced rule \"" + node.name + "\" does not exist.",
|
||||
"Rule \"" + node.name + "\" is not defined.",
|
||||
node.location
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ describe("compiler pass |reportMissingRules|", function() {
|
|||
|
||||
it("reports missing rules", function() {
|
||||
expect(pass).toReportError('start = missing', {
|
||||
message: 'Referenced rule "missing" does not exist.',
|
||||
message: 'Rule "missing" is not defined.',
|
||||
location: {
|
||||
start: { offset: 8, line: 1, column: 9 },
|
||||
end: { offset: 15, line: 1, column: 16 }
|
||||
|
|
Loading…
Reference in a new issue