Update deps & micro fix

This commit is contained in:
Shunsuke Shibayama 2023-01-26 11:47:30 +09:00
parent e464e8dc79
commit 36427cb647
4 changed files with 22 additions and 19 deletions

32
Cargo.lock generated
View File

@ -252,8 +252,8 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
[[package]] [[package]]
name = "els" name = "els"
version = "0.1.14-nightly.1" version = "0.1.15"
source = "git+https://github.com/erg-lang/erg?branch=main#c8253e89019445766657c0270f8213dba0fa4c94" source = "git+https://github.com/erg-lang/erg?branch=main#4b08fd21a286916b0f3e3499aec2b9299082516d"
dependencies = [ dependencies = [
"erg_common", "erg_common",
"erg_compiler", "erg_compiler",
@ -273,8 +273,8 @@ dependencies = [
[[package]] [[package]]
name = "erg_common" name = "erg_common"
version = "0.6.2-nightly.1" version = "0.6.3"
source = "git+https://github.com/erg-lang/erg?branch=main#c8253e89019445766657c0270f8213dba0fa4c94" source = "git+https://github.com/erg-lang/erg?branch=main#4b08fd21a286916b0f3e3499aec2b9299082516d"
dependencies = [ dependencies = [
"backtrace-on-stack-overflow", "backtrace-on-stack-overflow",
"hermit-abi", "hermit-abi",
@ -284,8 +284,8 @@ dependencies = [
[[package]] [[package]]
name = "erg_compiler" name = "erg_compiler"
version = "0.6.2-nightly.1" version = "0.6.3"
source = "git+https://github.com/erg-lang/erg?branch=main#c8253e89019445766657c0270f8213dba0fa4c94" source = "git+https://github.com/erg-lang/erg?branch=main#4b08fd21a286916b0f3e3499aec2b9299082516d"
dependencies = [ dependencies = [
"erg_common", "erg_common",
"erg_parser", "erg_parser",
@ -293,8 +293,8 @@ dependencies = [
[[package]] [[package]]
name = "erg_parser" name = "erg_parser"
version = "0.6.2-nightly.1" version = "0.6.3"
source = "git+https://github.com/erg-lang/erg?branch=main#c8253e89019445766657c0270f8213dba0fa4c94" source = "git+https://github.com/erg-lang/erg?branch=main#4b08fd21a286916b0f3e3499aec2b9299082516d"
dependencies = [ dependencies = [
"erg_common", "erg_common",
"unicode-xid 0.2.4", "unicode-xid 0.2.4",
@ -349,9 +349,9 @@ dependencies = [
[[package]] [[package]]
name = "gimli" name = "gimli"
version = "0.27.0" version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
@ -527,9 +527,9 @@ dependencies = [
[[package]] [[package]]
name = "object" name = "object"
version = "0.30.2" version = "0.30.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -589,9 +589,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.49" version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1011,9 +1011,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.8" version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"

View File

@ -1402,7 +1402,10 @@ impl ASTConverter {
self.convert_ident("__import__".to_string(), stmt.location), self.convert_ident("__import__".to_string(), stmt.location),
)); ));
// from . import foo ==> import "./foo" // from . import foo ==> import "./foo"
let cont = format!("\"{}\"", module.clone().unwrap_or(names[0].symbol.clone())); let cont = format!(
"\"{}\"",
module.clone().unwrap_or_else(|| names[0].symbol.clone())
);
let mod_name = Expr::Lit(Literal::new(Token::new( let mod_name = Expr::Lit(Literal::new(Token::new(
TokenKind::StrLit, TokenKind::StrLit,
cont, cont,

View File

@ -132,8 +132,8 @@ impl PythonAnalyzer {
} }
pub fn run(&mut self) { pub fn run(&mut self) {
let filename = self.cfg.input.filename();
let py_code = self.cfg.input.read(); let py_code = self.cfg.input.read();
let filename = self.cfg.input.filename();
println!("{BLUE}Start checking{RESET}: {filename}"); println!("{BLUE}Start checking{RESET}: {filename}");
match self.analyze(py_code, "exec") { match self.analyze(py_code, "exec") {
Ok(artifact) => { Ok(artifact) => {

View File

@ -40,7 +40,7 @@ pub fn parse_args() -> ErgConfig {
.expect("the value of `--verbose` is not a number"); .expect("the value of `--verbose` is not a number");
} }
"-V" | "--version" => { "-V" | "--version" => {
println!("Erg {}", env!("CARGO_PKG_VERSION")); println!("pylyzer {}", env!("CARGO_PKG_VERSION"));
std::process::exit(0); std::process::exit(0);
} }
other if other.starts_with('-') => { other if other.starts_with('-') => {