Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for {} imports #7

Merged
merged 1 commit into from
Feb 15, 2021
Merged

Conversation

corollari
Copy link
Contributor

Title is self-explanatory, this just adds support for imports of the type import {Contract} from "something.sol";

@corollari corollari force-pushed the patch-1 branch 3 times, most recently from f45b7bd to 7de17f9 Compare January 1, 2021 06:11
@corollari
Copy link
Contributor Author

Related to #1

@PaulRBerg
Copy link
Owner

Hey Albert, thanks for your PR.

I ran your modified regex expression on regexr.com and unfortunately it didn't match the {} imports:

Capture d’écran 2021-01-10 à 16 42 42

@corollari
Copy link
Contributor Author

corollari commented Jan 10, 2021

When the string \\ gets evaluated by the rust compiler it becomes \, so what is getting actually passed to the regex matcher is import (?:\{[^{}]*\} from )?['\"](.*?.sol)['\"]; (actually \" also becomes ", but this is irrelevant)

image

@corollari
Copy link
Contributor Author

@PaulRBerg thoughts?

@PaulRBerg
Copy link
Owner

PaulRBerg commented Feb 9, 2021

Hey Albert, your follow-up comment fell through the cracks for me. I will look at this during the weekend and very likely include your proposed change as part of [email protected]

@PaulRBerg PaulRBerg merged commit 611cfae into PaulRBerg:main Feb 15, 2021
@PaulRBerg
Copy link
Owner

Thanks for your contribution, @corollari! I just shipped it via v1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants