You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to rewrite the paths in import statements, we are trying to find the import paths via naive regular expressions like /^\s*import /i, which work for most cases but are insufficient to parse all valid solidity productions.
This causes both false positives, exemplified by the current implementation modifying imports which are alone in their line but inside multiline comments:
And false negatives, such as failing to detect a second import statement in a single line:
import 'foo/Foo.sol'; import 'foo/Bar.sol';
The way to properly fix this is to use a 3-rd party parser, such as solidity-parser or solc-typed-ast to extract the locations of the import statements and their path attributes.
The text was updated successfully, but these errors were encountered:
In order to rewrite the paths in import statements, we are trying to find the import paths via naive regular expressions like
/^\s*import /i
, which work for most cases but are insufficient to parse all valid solidity productions.This causes both false positives, exemplified by the current implementation modifying imports which are alone in their line but inside multiline comments:
And false negatives, such as failing to detect a second import statement in a single line:
The way to properly fix this is to use a 3-rd party parser, such as solidity-parser or solc-typed-ast to extract the locations of the import statements and their path attributes.
The text was updated successfully, but these errors were encountered: