Ruby: improve wording of error messages

This commit is contained in:
Arthur Baars
2023-02-16 15:53:56 +01:00
parent 51f34eb3e9
commit 6fd836d3a9
3 changed files with 14 additions and 9 deletions

View File

@@ -306,15 +306,20 @@ impl<'a> Visitor<'a> {
fn enter_node(&mut self, node: Node) -> bool {
if node.is_missing() {
self.record_parse_error_for_node(
"parse error: expecting {}",
&[node.kind()],
"A parse error occurred, expecting {} symbol. Check the syntax of the file using the {} command. If the file is indeed invalid, please correct the error or exclude the file from analysis.",
&[node.kind(), "ruby -c"],
node,
true,
);
return false;
}
if node.is_error() {
self.record_parse_error_for_node("parse error", &[], node, true);
self.record_parse_error_for_node(
"A parse error occurred. Check the syntax of the file using the {} command. If the file is indeed invalid, please correct the error or exclude the file from analysis.",
&["ruby -c"],
node,
true,
);
return false;
};