mirror of https://github.com/mtshiba/pylyzer
update deps
This commit is contained in:
parent
70c23905ae
commit
b35a26bba4
|
|
@ -124,9 +124,9 @@ checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
|
|||
|
||||
[[package]]
|
||||
name = "els"
|
||||
version = "0.1.45-nightly.2"
|
||||
version = "0.1.48-nightly.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49404b037f820c6e8b8a15584af22a5fccabe74d519357ba3766921fb5e3d5e3"
|
||||
checksum = "9fc7d9b7e85dd36847b2e3fcb4a400c1f25a49c7ecfa0e9f25bdad91070cba32"
|
||||
dependencies = [
|
||||
"erg_common",
|
||||
"erg_compiler",
|
||||
|
|
@ -138,9 +138,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "erg_common"
|
||||
version = "0.6.33-nightly.2"
|
||||
version = "0.6.36-nightly.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8664ce92ba1d715ca25d6dbb8079edf0a4d68fb11a53725fdab8f3e689c93f7c"
|
||||
checksum = "e25256e6a5de7886319cf6bc830b92b04a9f722eac3fdf43a82fc9d43e9336a1"
|
||||
dependencies = [
|
||||
"backtrace-on-stack-overflow",
|
||||
"erg_proc_macros",
|
||||
|
|
@ -150,9 +150,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "erg_compiler"
|
||||
version = "0.6.33-nightly.2"
|
||||
version = "0.6.36-nightly.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d242a00905c54ffe9427889277a99f782f0e5a8eb8a6e508a45d40dca075f1e"
|
||||
checksum = "d224db567e7d13a30a52f7178623434922d781d8bc4310c7adae7052ec21cb18"
|
||||
dependencies = [
|
||||
"erg_common",
|
||||
"erg_parser",
|
||||
|
|
@ -160,9 +160,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "erg_parser"
|
||||
version = "0.6.33-nightly.2"
|
||||
version = "0.6.36-nightly.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "762fe7e8e90c34e834f1c37ee00db1a3b004a45f57efbbc9689a93443e77e51f"
|
||||
checksum = "16ba6fbccd31c15bc032fbd52be75b7965f10a192adfed440e2d961bdd52e47f"
|
||||
dependencies = [
|
||||
"erg_common",
|
||||
"erg_proc_macros",
|
||||
|
|
@ -171,9 +171,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "erg_proc_macros"
|
||||
version = "0.6.33-nightly.2"
|
||||
version = "0.6.36-nightly.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d0aa1b2d6dd1f6d22553926c4d7054a1ba2419cf27db8913925b7fddbbba48d"
|
||||
checksum = "40f73fb45d76f14edb6076c1b0bbd0c9ee7531663595674dd6ae667d13fed769"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -391,9 +391,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "molc"
|
||||
version = "0.2.8"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "518188a50ad95f57dd852ec777c4dfd65ed2402fdc0e20fa47628f98f215eee6"
|
||||
checksum = "4584f5f0dfee2be636c6413e44e0b73e23ea299d212fa7124d4c87696533c8a8"
|
||||
dependencies = [
|
||||
"lsp-types",
|
||||
"serde",
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ edition = "2021"
|
|||
repository = "https://github.com/mtshiba/pylyzer"
|
||||
|
||||
[workspace.dependencies]
|
||||
erg_common = { version = "0.6.33-nightly.2", features = ["py_compat", "els"] }
|
||||
erg_compiler = { version = "0.6.33-nightly.2", features = ["py_compat", "els"] }
|
||||
els = { version = "0.1.45-nightly.2", features = ["py_compat"] }
|
||||
erg_common = { version = "0.6.36-nightly.0", features = ["py_compat", "els"] }
|
||||
erg_compiler = { version = "0.6.36-nightly.0", features = ["py_compat", "els"] }
|
||||
els = { version = "0.1.48-nightly.0", features = ["py_compat"] }
|
||||
# rustpython-parser = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] }
|
||||
# rustpython-ast = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] }
|
||||
rustpython-parser = { git = "https://github.com/RustPython/Parser", version = "0.3.1", features = ["all-nodes-with-ranges", "location"] }
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@ use erg_common::traits::{Locational, Stream};
|
|||
use erg_common::{log, set};
|
||||
use erg_compiler::artifact::IncompleteArtifact;
|
||||
use erg_compiler::erg_parser::ast::{
|
||||
Accessor, Args, Array, BinOp, Block, ClassAttr, ClassAttrs, ClassDef, ConstAccessor, ConstArgs,
|
||||
Accessor, Args, List, BinOp, Block, ClassAttr, ClassAttrs, ClassDef, ConstAccessor, ConstArgs,
|
||||
ConstAttribute, ConstDict, ConstExpr, ConstKeyValue, ConstPosArg, Decorator, Def, DefBody,
|
||||
DefId, DefaultParamSignature, Dict, Dummy, Expr, Identifier, KeyValue, KwArg, Lambda,
|
||||
LambdaSignature, Literal, Methods, Module, NonDefaultParamSignature, NormalArray, NormalDict,
|
||||
LambdaSignature, Literal, Methods, Module, NonDefaultParamSignature, NormalList, NormalDict,
|
||||
NormalRecord, NormalSet, NormalTuple, ParamPattern, ParamTySpec, Params, PosArg,
|
||||
PreDeclTypeSpec, ReDef, Record, RecordAttrs, Set, Signature, SubrSignature, SubrTypeSpec,
|
||||
Tuple, TupleTypeSpec, TypeAscription, TypeBoundSpecs, TypeSpec, TypeSpecWithOp, UnaryOp,
|
||||
VarName, VarPattern, VarRecordAttr, VarRecordAttrs, VarRecordPattern, VarSignature,
|
||||
VisModifierSpec, ArrayComprehension, SetComprehension,
|
||||
VisModifierSpec, ListComprehension, SetComprehension,
|
||||
};
|
||||
use erg_compiler::erg_parser::desugar::Desugarer;
|
||||
use erg_compiler::erg_parser::token::{Token, TokenKind, COLON, DOT, EQUAL};
|
||||
|
|
@ -100,7 +100,7 @@ fn escape_name(name: String) -> String {
|
|||
"complex" => "Complex".into(),
|
||||
"str" => "Str".into(),
|
||||
"bool" => "Bool".into(),
|
||||
"list" => "GenericArray".into(),
|
||||
"list" => "GenericList".into(),
|
||||
"bytes" => "Bytes".into(),
|
||||
// "range" => "GenericRange".into(),
|
||||
"dict" => "GenericDict".into(),
|
||||
|
|
@ -794,7 +794,7 @@ impl ASTConverter {
|
|||
ConstExpr::Accessor(ConstAccessor::Local(Identifier::private("global".into())));
|
||||
let acc = ConstAccessor::Attr(ConstAttribute::new(
|
||||
global,
|
||||
Identifier::private("Array!".into()),
|
||||
Identifier::private("List!".into()),
|
||||
));
|
||||
TypeSpec::poly(acc, ConstArgs::new(vec![elem_t, len], None, vec![], None, None))
|
||||
}
|
||||
|
|
@ -1148,7 +1148,7 @@ impl ASTConverter {
|
|||
.map(|ex| PosArg::new(self.convert_expr(ex)))
|
||||
.collect::<Vec<_>>();
|
||||
let elems = Args::pos_only(elements, None);
|
||||
let arr = Expr::Array(Array::Normal(NormalArray::new(l_sqbr, r_sqbr, elems)));
|
||||
let arr = Expr::List(List::Normal(NormalList::new(l_sqbr, r_sqbr, elems)));
|
||||
Self::mutate_expr(arr)
|
||||
}
|
||||
py_ast::Expr::ListComp(comp) => {
|
||||
|
|
@ -1168,7 +1168,7 @@ impl ASTConverter {
|
|||
.next()
|
||||
.map(|ex| self.convert_expr(ex));
|
||||
let generators = vec![(ident, iter)];
|
||||
let arr = Expr::Array(Array::Comprehension(ArrayComprehension::new(l_sqbr, r_sqbr, Some(layout), generators, guard)));
|
||||
let arr = Expr::List(List::Comprehension(ListComprehension::new(l_sqbr, r_sqbr, Some(layout), generators, guard)));
|
||||
Self::mutate_expr(arr)
|
||||
}
|
||||
py_ast::Expr::Set(set) => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use erg_common::traits::{New, ExitStatus, Runnable, Stream};
|
|||
use erg_common::Str;
|
||||
use erg_compiler::GenericHIRBuilder;
|
||||
use erg_compiler::artifact::{BuildRunnable, Buildable, CompleteArtifact, IncompleteArtifact};
|
||||
use erg_compiler::build_package::{GenericPackageBuilder, CheckStatus};
|
||||
use erg_compiler::build_package::{CheckStatus, GenericPackageBuilder};
|
||||
use erg_compiler::context::ModuleContext;
|
||||
use erg_compiler::erg_parser::ast::{Module, AST};
|
||||
use erg_compiler::erg_parser::build_ast::ASTBuildable;
|
||||
|
|
|
|||
|
|
@ -79,11 +79,12 @@ pub(crate) fn parse_args() -> ErgConfig {
|
|||
ownership_check: false,
|
||||
..ErgConfig::default()
|
||||
};
|
||||
let mut runtime_args: Vec<&'static str> = Vec::new();
|
||||
while let Some(arg) = args.next() {
|
||||
match &arg[..] {
|
||||
"--" => {
|
||||
for arg in args {
|
||||
cfg.runtime_args.push(Box::leak(arg.into_boxed_str()));
|
||||
runtime_args.push(Box::leak(arg.into_boxed_str()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -131,12 +132,13 @@ For more information try `pylyzer --help`"
|
|||
);
|
||||
if let Some("--") = args.next().as_ref().map(|s| &s[..]) {
|
||||
for arg in args {
|
||||
cfg.runtime_args.push(Box::leak(arg.into_boxed_str()));
|
||||
runtime_args.push(Box::leak(arg.into_boxed_str()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg.runtime_args = runtime_args.into();
|
||||
cfg
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use erg_common::config::ErgConfig;
|
||||
use erg_common::io::Input;
|
||||
use erg_common::spawn::exec_new_thread;
|
||||
use erg_common::traits::Stream;
|
||||
use erg_compiler::artifact::{CompleteArtifact, IncompleteArtifact};
|
||||
use pylyzer::PythonAnalyzer;
|
||||
|
||||
|
|
@ -61,6 +60,15 @@ fn exec_test() -> Result<(), String> {
|
|||
|
||||
#[test]
|
||||
fn exec_import() -> Result<(), String> {
|
||||
if Path::new("tests/__pycache__").exists() {
|
||||
std::fs::remove_dir_all("tests/__pycache__").unwrap();
|
||||
}
|
||||
if Path::new("tests/foo/__pycache__").exists() {
|
||||
std::fs::remove_dir_all("tests/foo/__pycache__").unwrap();
|
||||
}
|
||||
if Path::new("tests/bar/__pycache__").exists() {
|
||||
std::fs::remove_dir_all("tests/bar/__pycache__").unwrap();
|
||||
}
|
||||
expect("tests/import.py", 1, 2)
|
||||
}
|
||||
|
||||
|
|
@ -110,8 +118,8 @@ fn exec_casting() -> Result<(), String> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn exec_collections() -> Result<(), String> {
|
||||
expect("tests/collections.py", 0, 4)
|
||||
fn exec_collection() -> Result<(), String> {
|
||||
expect("tests/collection.py", 0, 4)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in New Issue