Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

chore(deps): bump solang-parser 0.2.1 #2054

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion ethers-solc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tempfile = { version = "3.3.0", optional = true }
fs_extra = { version = "1.2.0", optional = true }
sha2 = { version = "0.10.6", default-features = false, optional = true }
dunce = "1.0.3"
solang-parser = { default-features = false, version = "=0.1.18" }
solang-parser = { default-features = false, version = "=0.2.1" }
rayon = "1.6.0"
rand = { version = "0.8.5", optional = true }
path-slash = "0.2.1"
Expand Down
19 changes: 10 additions & 9 deletions ethers-solc/src/resolver/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl SolData {
Ok((units, _)) => {
for unit in units.0 {
match unit {
SourceUnitPart::PragmaDirective(loc, pragma, value) => {
SourceUnitPart::PragmaDirective(loc, Some(pragma), Some(value)) => {
if pragma.name == "solidity" {
// we're only interested in the solidity version pragma
version = Some(SolDataUnit::from_loc(value.string.clone(), loc));
Expand Down Expand Up @@ -86,15 +86,16 @@ impl SolData {
_ => None,
})
.collect();
let name = def.name.name;
match def.ty {
ContractTy::Contract(_) => {
contracts.push(SolContract { name, functions });
if let Some(name) = def.name {
match def.ty {
ContractTy::Contract(_) => {
contracts.push(SolContract { name: name.name, functions });
}
ContractTy::Library(_) => {
libraries.push(SolLibrary { name: name.name, functions });
}
_ => {}
}
ContractTy::Library(_) => {
libraries.push(SolLibrary { name, functions });
}
_ => {}
}
}
_ => {}
Expand Down