mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 04:24:43 +00:00
Add AtomicStr
This commit is contained in:
parent
fb36c0d633
commit
fe1b0fab70
11 changed files with 300 additions and 105 deletions
|
@ -1,10 +1,10 @@
|
|||
//! defines `ParseError` and others.
|
||||
//!
|
||||
//! パーサーが出すエラーを定義
|
||||
use erg_common::astr::AtomicStr;
|
||||
use erg_common::config::Input;
|
||||
use erg_common::error::{ErrorCore, ErrorDisplay, ErrorKind::*, Location, MultiErrorDisplay};
|
||||
use erg_common::traits::Stream;
|
||||
use erg_common::Str;
|
||||
use erg_common::{impl_stream_for_wrapper, switch_lang};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -65,20 +65,20 @@ impl LexError {
|
|||
))
|
||||
}
|
||||
|
||||
pub fn syntax_error<S: Into<Str>>(
|
||||
pub fn syntax_error<S: Into<AtomicStr>>(
|
||||
errno: usize,
|
||||
loc: Location,
|
||||
desc: S,
|
||||
hint: Option<Str>,
|
||||
hint: Option<AtomicStr>,
|
||||
) -> Self {
|
||||
Self::new(ErrorCore::new(errno, SyntaxError, loc, desc, hint))
|
||||
}
|
||||
|
||||
pub fn syntax_warning<S: Into<Str>>(
|
||||
pub fn syntax_warning<S: Into<AtomicStr>>(
|
||||
errno: usize,
|
||||
loc: Location,
|
||||
desc: S,
|
||||
hint: Option<Str>,
|
||||
hint: Option<AtomicStr>,
|
||||
) -> Self {
|
||||
Self::new(ErrorCore::new(errno, SyntaxWarning, loc, desc, hint))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue