mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-24 13:34:52 +00:00
feat(REPL): add err type
This commit is contained in:
parent
8e5850d943
commit
b10b57d8e3
2 changed files with 20 additions and 0 deletions
|
@ -169,6 +169,25 @@ impl LexError {
|
|||
))
|
||||
}
|
||||
|
||||
pub fn expect_next_line_error(errno: usize, loc: Location, caused: &str) -> Self {
|
||||
Self::new(ErrorCore::new(
|
||||
vec![SubMessage::ambiguous_new(
|
||||
loc,
|
||||
vec![caused.to_string()],
|
||||
None,
|
||||
)],
|
||||
switch_lang!(
|
||||
"japanese" => "ブロックが期待されていますが、EOFが与えられました",
|
||||
"simplified_chinese" => "该块是预期的,但是是 EOF",
|
||||
"traditional_chinese" => "該塊是預期的,但是是 EOF",
|
||||
"english" => "The block is expected, but is EOF",
|
||||
),
|
||||
errno,
|
||||
ExpectNextLine,
|
||||
loc,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn syntax_error<S: Into<String>>(
|
||||
errno: usize,
|
||||
loc: Location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue