Skip to content

Commit

Permalink
update: add covert annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
GreasySlug committed Jan 1, 2023
1 parent 5737088 commit f174826
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions compiler/erg_parser/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ impl Parser {
}
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"rhs",
"signature",
);
self.errs.push(err);
Err(())
}
Expand All @@ -88,7 +93,12 @@ impl Parser {
}
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"accessor",
"variable signature",
);
self.errs.push(err);
Err(())
}
Expand All @@ -110,7 +120,12 @@ impl Parser {
}
Signature::Subr(subr) => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, subr.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
subr.loc(),
"array",
"array pattern",
);
self.errs.push(err);
return Err(());
}
Expand Down Expand Up @@ -294,7 +309,12 @@ impl Parser {
}
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"accessor",
"indemnifier",
);
self.errs.push(err);
return Err(());
}
Expand Down Expand Up @@ -336,7 +356,12 @@ impl Parser {
Ok(bound)
}
other => {
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"type argument",
"bound",
);
self.errs.push(err);
Err(())
}
Expand Down Expand Up @@ -466,7 +491,12 @@ impl Parser {
},
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"rhs",
"parameter",
);
self.errs.push(err);
Err(())
}
Expand Down Expand Up @@ -639,7 +669,12 @@ impl Parser {
}
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"hls",
"lambda signature",
);
self.errs.push(err);
Err(())
}
Expand All @@ -663,7 +698,12 @@ impl Parser {
}
other => {
self.level -= 1;
let err = ParseError::simple_syntax_error(line!() as usize, other.loc());
let err = ParseError::failed_to_convert_error(
line!() as usize,
other.loc(),
"accessor",
"parameter signature",
);
self.errs.push(err);
Err(())
}
Expand Down

0 comments on commit f174826

Please sign in to comment.