-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Regexp catching keywords inside strings #24
Comments
Hello @rrodriguezreche, Can you please provide a small contract to reproduce this issue? Or should I use the code above to check it? Basically I need some steps to reproduce the issue? Basically if you are using library directly, you should use Best regards |
Hi @RyuuGan , the above code can do with the reproduction, but I 'll have something prepared, I hope at the end of today, with a smaller stub and a example repository. I uploaded https://github.com/rrodriguezreche/verify-bug as an example for the truffle-plugin-verify (which uses this library), because I thought originally that the issue was with them (rkalis/truffle-plugin-verify#25), but as I debugged it a little more, I found the conflicting code was here. Regards! |
Hi @RyuuGan , sorry for the delay. Attaching here a minimal repository to reproduce: https://github.com/rrodriguezreche/sol-merger-bug |
Should be fixed in |
FileAnalyzer
divides the source code in "groups" based on the regexpconst exportRegex = /(contract|library|interface)\s+([a-zA-Z_$][a-zA-Z_$0-9]*)\s*([\s\S]*?)\{/g;
.This grouping breaks if a line contains a keyword inside a string. For example:
require(!to.isContract(), "ERC777: token recipient contract has no implementer for ERC777TokensRecipient");
Inside the implementation of open-zeppelin's
ERC-777
:In this case the
contract
keyword gets detected and sol-merger spawns a new group. The next group (Ownable) gets wrong syntax, so I think it gets removed.A workaround right now would be to avoid keywords inside the
require
statements (or any other string) in the solidity file.I am thinking of a better way to do the grouping right now, or at least provisionally avoid the collision the
contract
keyword.The text was updated successfully, but these errors were encountered: