Skip to content

Commit

Permalink
fix: minor bugs
Browse files Browse the repository at this point in the history
update deps
  • Loading branch information
mtshiba committed Sep 26, 2024
1 parent a1ffcf0 commit b854eb7
Show file tree
Hide file tree
Showing 10 changed files with 2,636 additions and 2,589 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,31 @@ jobs:
run: |
pip3 install idna
pylyzer -c "import idna" || true
- name: typing-extensions
run: |
pip3 install typing-extensions
pylyzer -c "import typing_extensions" || true
- name: python-dateutil
run: |
pip3 install python-dateutil
pylyzer -c "import dateutil" || true
- name: packaging
run: |
pip3 install packaging
pylyzer -c "import packaging" || true
- name: six
run: |
pip3 install six
pylyzer -c "import six" || true
- name: s3transfer
run: |
pip3 install s3transfer
pylyzer -c "import s3transfer" || true
- name: pyyaml
run: |
pip3 install pyyaml
pylyzer -c "import yaml" || true
- name: cryptography
run: |
pip3 install cryptography
pylyzer -c "import cryptography" || true
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ edition = "2021"
repository = "https://github.com/mtshiba/pylyzer"

[workspace.dependencies]
erg_common = { version = "0.6.45-nightly.0", features = ["py_compat", "els"] }
erg_compiler = { version = "0.6.45-nightly.0", features = ["py_compat", "els"] }
els = { version = "0.1.57-nightly.0", features = ["py_compat"] }
erg_common = { version = "0.6.45-nightly.3", features = ["py_compat", "els"] }
erg_compiler = { version = "0.6.45-nightly.3", features = ["py_compat", "els"] }
els = { version = "0.1.57-nightly.3", 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.4.0", features = ["all-nodes-with-ranges", "location"] }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker.
* [x] `Callable`
* [ ] `TypedDict`
* [x] `TypeVar`
* [ ] `ClassVar`
* [ ] `Generic`
* [ ] `Protocol`
* [ ] `Final`
Expand Down
6 changes: 5 additions & 1 deletion crates/py2erg/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl ASTConverter {
name_info.defined_in = DefinedPlace::Known(cur_namespace);
name_info.defined_times += 1; // 0 -> 1
}
if name_info.defined_block_id == cur_block_id {
if name_info.defined_block_id == cur_block_id || name_info.defined_times == 0 {
CanShadow::Yes
} else {
CanShadow::No
Expand Down Expand Up @@ -1388,6 +1388,10 @@ impl ASTConverter {
);
method.call1(self.convert_expr(*subs.slice))
}
// [start:] == [slice(start, None)]
// [:stop] == [slice(stop)]
// [start:stop] == [slice(start, stop)]
// [start:stop:step] == [slice(start, stop, step)]
py_ast::Expr::Slice(slice) => {
let loc = slice.location();
let start = slice.lower.map(|ex| self.convert_expr(*ex));
Expand Down
Loading

0 comments on commit b854eb7

Please sign in to comment.