mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
fix: display error instead of crash when ERG_PATH
is not found
This commit is contained in:
parent
c4205c4ddd
commit
219611b813
2 changed files with 22 additions and 17 deletions
|
@ -466,23 +466,13 @@ const KW_SUPER: &str = "Super";
|
|||
const KW_MAXSPLIT: &str = "maxsplit";
|
||||
const KW_SUB: &str = "sub";
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
pub fn builtins_path() -> PathBuf {
|
||||
erg_common::env::erg_pystd_path().join("builtins.d.er")
|
||||
}
|
||||
#[cfg(feature = "no_std")]
|
||||
pub fn builtins_path() -> PathBuf {
|
||||
PathBuf::from("lib/pystd/builtins.d.er")
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
pub fn std_decl_path() -> PathBuf {
|
||||
erg_common::env::erg_std_decl_path()
|
||||
}
|
||||
#[cfg(feature = "no_std")]
|
||||
pub fn std_decl_path() -> PathBuf {
|
||||
PathBuf::from("lib/std.d")
|
||||
}
|
||||
|
||||
impl Context {
|
||||
fn register_builtin_decl(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue